Deeploy.Targets.Generic.Platform.GenericTransientBuffer
- class Deeploy.Targets.Generic.Platform.GenericTransientBuffer(name: str = '', size=0)
Bases:
TransientBuffer
Methods
- __init__(name: str = '', size=0)
__init__
([name, size])add_aliases
(aliases_to_add)Adds list of aliases to the alias_of attribute.
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)fromVariableBuffer
(buffer)Getter function for the alias_of attribute.
has_live_ancestors
(ctxt)Checks whether this VariableBuffer has any live ancestors, i.e. buffers that are still live and are aliased by this buffer.
init
()Return a string representation of the C code to declare this memory buffer
Attributes
Holds the buffer's allocation code
Holds the buffer's deallocation code
Holds the buffer's initialization code
Total BYTE size of this TransientBuffer
Canonical name that this buffer is registered as in the NetworkContext
Represents the dimensions of the underlying tensor as a sequence of dimension sizes
- initTemplate: NodeTemplate = <Deeploy.DeeployTypes.NodeTemplate object>
Holds the buffer’s initialization code
- Type:
- allocTemplate: NodeTemplate = <Deeploy.DeeployTypes.NodeTemplate object>
Holds the buffer’s allocation code
- Type:
- deallocTemplate: NodeTemplate = <Deeploy.DeeployTypes.NodeTemplate object>
Holds the buffer’s deallocation code
- Type:
- add_aliases(aliases_to_add: List[str])
Adds list of aliases to the alias_of attribute. :param alias_to_add: List of names of aliases to add to the alias_of attribute. :type alias_to_add: List[str]
- Return type:
None
- 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
- get_aliases_of()
Getter function for the alias_of attribute. :returns: List of names o all aliases of this VariableBuffer. :rtype: List[str]
- has_live_ancestors(ctxt: NetworkContext) bool
Checks whether this VariableBuffer has any live ancestors, i.e. buffers that are still live and are aliased by this buffer. :param ctxt: Current NetworkContext :type ctxt: NetworkContext
- Returns:
True if this VariableBuffer has any live ancestors, False otherwise
- Return type:
bool
- 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
- 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]
- size
Total BYTE size of this TransientBuffer
- Type:
int