Deeploy.DeeployTypes.VariableBuffer

class Deeploy.DeeployTypes.VariableBuffer(name: str = '', shape=[1])

Bases: object

This class represents memory locations containing variable tensor data that is not transient, i.e. intermediate results or input- and output buffers.

Methods

__init__(name: str = '', shape=[1])

__init__([name, shape])

alloc()

Return a string representation of the C code required to allocated this memory buffer

dealloc()

Return a string representation of the C code to deallocate/free this memory buffer at runtime

fromNode(node)

init()

Return a string representation of the C code to declare this memory buffer

Attributes

initTemplate

Holds the buffer's initialization code

allocTemplate

Holds the buffer's allocation code

deallocTemplate

Holds the buffer's deallocation code

name

Canonical name that this buffer is registered as in the NetworkContext

shape

Represents the dimensions of the underlying tensor as a sequence of dimension sizes

initTemplate: NodeTemplate

Holds the buffer’s initialization code

Type:

NodeTemplate

allocTemplate: NodeTemplate

Holds the buffer’s allocation code

Type:

NodeTemplate

deallocTemplate: NodeTemplate

Holds the buffer’s deallocation code

Type:

NodeTemplate

name: str

Canonical name that this buffer is registered as in the NetworkContext

Type:

str

shape: Sequence[int]

Represents the dimensions of the underlying tensor as a sequence of dimension sizes

Type:

Sequence[int]

init() str

Return a string representation of the C code to declare this memory buffer

Returns:

C Code to declare this buffer

Return type:

str

alloc() str

Return a string representation of the C code required to allocated this memory buffer

Returns:

C Code to allocate this buffer

Return type:

str

dealloc() str

Return a string representation of the C code to deallocate/free this memory buffer at runtime

Returns:

C Code to free this buffer

Return type:

str