Skip to content
heliaAOT
HELIA HUB

tensor

Machine-readable model

class

AirTensor

Python

AIR tensor representation.

helia_aot/air/tensor.py:30

AirTensor()

AIR tensor representation.

attribute

helia_aot/air/tensor.py:36

quantization: AirQuantizationParameters | None = Field(default_factory=AirQuantizationParameters, description='Quantization parameters for the tensor')
attribute

sparsity

Python

helia_aot/air/tensor.py:39

sparsity: AirSparsityParameters | None = Field(default_factory=AirSparsityParameters, description='Sparsity parameters for the tensor')
attribute

helia_aot/air/tensor.py:57

inferred_value: Array | None = Field(default=None, repr=False, description='Compile-time value that shape propagation computed for a shape-expression tensor: the output of a SHAPE, or of a STRIDED_SLICE or PACK over one. An operator still produces the tensor at run time, so this is not constant data; code that needs a constant reads `data`. FoldStaticShapeExpressions moves the value into `data` and removes the producing operator.')
attribute

helia_aot/air/tensor.py:68

fixed_offset: int | None = Field(None, description="Mandatory arena-relative byte offset imposed by an external compiler (e.g. Vela's OfflineMemoryAllocation for an Ethos-U subgraph). When set, the memory planner must place this tensor at exactly this offset within its writable arena instead of choosing one, because the offset is baked into a command stream. Such tensors may intentionally overlap one another.")
attribute

helia_aot/air/tensor.py:78

packed_from: TensorId | None = Field(None, description='Id of the tensor whose data a conversion-time repacking produced this one from. memory.tensors rules resolve against that id (see placement_id).')
attribute

quant

Python

Quantization parameters, which must be present.

helia_aot/air/tensor.py:154

quant: AirQuantizationParameters

Quantization parameters, which must be present.

quantization is Optional so a tensor can carry none; kernels that require quantized inputs read through this view and get a clear error naming the tensor instead of an attribute access on None.

attribute

Id that memory.tensors rules match: the source id for a repacked copy.

helia_aot/air/tensor.py:206

placement_id: TensorId

Id that memory.tensors rules match: the source id for a repacked copy.

attribute

ctype

Python

Return the C type of the tensor.

helia_aot/air/tensor.py:215

ctype: str

Return the C type of the tensor.

This is used for generating C code that operates on the tensor. For example, if the tensor is of type int16, the C type will be int16_t.

method

Return a NHWC padded shape tuple, padding missing axes with 1.

helia_aot/air/tensor.py:252

get_shape_nhwc(pre: bool = True) -> tuple[int, int, int, int]

Return a NHWC padded shape tuple, padding missing axes with 1.