Skip to content
heliaAOT
API Reference
HELIA HUB

views

Read-only views of what a conversion generated.

ConvertArgs.result_views asks AotConverter.convert() to fill ConversionResult.operators, tensors, regions and placements with the frozen records below. They describe the generated module, not the graph, memory plan and operator objects the converter works with, which stay internal and can change in any release.

Classes

Name Description
OperatorView One generated operator.
QuantizationView A tensor’s quantization parameters.
TensorView One tensor of the generated module.
RegionView One arena region of the generated module.
PlacementView Where one tensor lives.

Copyright 2025 Ambiq. All Rights Reserved.

Machine-readable model

  • OperatorViewclassOne generated operator, as ConversionResult.operators lists them in execution order.
  • QuantizationViewclassA tensor's quantization parameters: real = (q - zeropoint) scale.
  • TensorViewclassOne tensor of the generated module, as ConversionResult.tensors lists them.
  • RegionViewclassOne arena region of the generated module, as ConversionResult.regions lists them.
  • PlacementViewclassWhere one tensor lives, as ConversionResult.placements maps them by tensor id.
class

One generated operator, as ConversionResult.operators lists them in execution order.

helia_aot/views.py:82

OperatorView(
layer_index: int,
symbol: str,
type: str,
source_indices: tuple[int, ...],
input_ids: tuple[str, ...],
output_ids: tuple[str, ...],
local_tensor_ids: tuple[str, ...],
kernel_calls: Mapping[str, str] | None,
macs: int | None,
parameters: int | None,
) -> None

dataclass

One generated operator, as ConversionResult.operators lists them in execution order.

With module.schedule: table, the generated operator callback reports run_started and run_finished for the operators in this order, and its op argument is the operator’s layer_index.

attribute

symbol

Python

helia_aot/views.py:140

symbol: str

The name the operator’s generated code is built from, <prefix>_<type>_<id>: its _init and _run functions, where the module emits them, and its source files.

attribute

type

Python

helia_aot/views.py:141

type: str

The operator type: the name of its operator in the model file, a LiteRT builtin operator name such as CONV_2D or LESS, or a custom operator’s canonical key. A transform that rewrites an operator reports the type it generates, so a depthwise convolution that DEPTHWISE_TO_CONV rewrites is CONV_2D.

attribute

helia_aot/views.py:142

source_indices: tuple[int, ...]

The index of the operator in the model file that the operator was parsed from, in the converted subgraph. A fused activation is part of its LiteRT operator and adds no index. A transform that rewrites an operator keeps its index; an operator a transform removes, as FOLD_STATIC_SHAPE_EXPRESSIONS removes shape arithmetic, appears in no entry, and one a transform creates has none. A LiteRT model hook that reorders the subgraph or returns a copy of the model keeps every index. An operator a hook creates lists the indices the hook states for it: each rolled-GRU fusion states its own WHILE loop and the reshapes around it. An operator a hook creates without stating any, or rebuilds from the serialized model, has none.

attribute

helia_aot/views.py:145

local_tensor_ids: tuple[str, ...]

The ids of the operator’s own tensors, as lowered: weights, biases, quantization parameters, precomputed sums and scratch buffers. Each id appears once and none is in input_ids or output_ids; the order is not promised.

attribute

helia_aot/views.py:146

kernel_calls: Mapping[str, str] | None

Each heliaCORE function the operator’s generated code calls, keyed by its role, such as run; empty for an operator that calls none, or None when the operator does not record its calls.

attribute

macs

Python

helia_aot/views.py:147

macs: int | None

Multiply-accumulates per inference, a fused activation not counted, or None for an operator type with no defined count: CONV_2D, DEPTHWISE_CONV_2D and FULLY_CONNECTED count one per weight for each output row (the output’s elements over its last dimension), padded positions included; TRANSPOSE_CONV, and a CONV_2D rewritten from one, one per weight for each input row; BATCH_MATMUL one per output element for each element of the contracted dimension; AVERAGE_POOL_2D and MAX_POOL_2D count 0; every other type is None.

attribute

helia_aot/views.py:148

parameters: int | None

The elements of the operator’s constant weights and bias (a BATCH_MATMUL’s constant operands), as the model holds them before lowering repacks or folds them, a weight a DEQUANTIZE of a constant produces counted as that constant; None where macs is, and 0 for the pooling types.

class

A tensor's quantization parameters: real = (q - zeropoint) scale.

helia_aot/views.py:151

QuantizationView(scale: tuple[float, ...], zero_point: tuple[int, ...], axis: int) -> None

dataclass

A tensor’s quantization parameters: real = (q - zero_point) * scale.

class

One tensor of the generated module, as ConversionResult.tensors lists them.

helia_aot/views.py:166

TensorView(
id: str,
name: str | None,
shape: tuple[int, ...],
dtype: str,
ctype: str,
quantization: QuantizationView | None,
kind: TensorKind,
input_index: int | None,
output_index: int | None,
nbytes: int,
) -> None

dataclass

One tensor of the generated module, as ConversionResult.tensors lists them.

The list follows the generated tensor enumeration: the tensor at index i is the one the module’s <prefix>_tensor_ident_t numbers i.

attribute

name

Python

helia_aot/views.py:193

name: str | None

The model’s name for the tensor, or None for an unnamed one or one the conversion created.

attribute

kind

Python

helia_aot/views.py:198

kind: TensorKind

input for a model input, otherwise output for a model output, otherwise constant, persistent or scratch. A tensor that is both a model input and a model output is input; input_index and output_index carry both roles.

attribute

helia_aot/views.py:199

input_index: int | None

The tensor’s position in the module’s inputs, the index of <prefix>_inputs_id and ctx->inputs it fills, or None.

attribute

helia_aot/views.py:200

output_index: int | None

The tensor’s position in the module’s outputs, the index of <prefix>_outputs_id and ctx->outputs, or None.

class

One arena region of the generated module, as ConversionResult.regions lists them.

helia_aot/views.py:204

RegionView(
id: int,
memory: MemoryType,
source_memory: MemoryType,
role: RegionRole,
offset: int,
size: int,
alignment: int,
symbol: str | None,
source_symbol: str | None,
source_offset: int,
sidecar_file: str | None,
) -> None

dataclass

One arena region of the generated module, as ConversionResult.regions lists them.

The region at index i has id == i, the value of its enumerator in the module’s <prefix>_arena_region_t, which <prefix>_bind_arena takes and the residency report’s region_id uses.

attribute

helia_aot/views.py:238

source_memory: MemoryType

The memory a staged constant region is copied from at initialization; memory for every other region.

attribute

offset

Python

helia_aot/views.py:240

offset: int

The bytes from symbol to the region’s first usable byte: an address-zero guard ahead of a generated ITCM region, otherwise 0.

attribute

symbol

Python

helia_aot/views.py:243

symbol: str | None

The C object the module emits for the region, or None when the application binds it (memory.allocate_arenas: false).

attribute

helia_aot/views.py:244

source_symbol: str | None

The C object holding a staged constant region’s bytes before they are copied, emitted in both arena modes, or None.

attribute

helia_aot/views.py:245

source_offset: int

The bytes from source_symbol to the first of those bytes: an address-zero guard ahead of a source in ITCM, otherwise 0.

attribute

helia_aot/views.py:246

sidecar_file: str | None

The file, relative to the module directory, the module writes a constant region’s size bytes to when memory.allocate_arenas is false, or None. It holds the data only, never an address-zero guard. A cold constant region is bound to these bytes; a staged one is copied at initialization from source_symbol, whose data are the same bytes.

class

Where one tensor lives, as ConversionResult.placements maps them by tensor id.

helia_aot/views.py:249

PlacementView(region: int | None, offset: int, size: int, source_memory: MemoryType, staged: bool) -> None

dataclass

Where one tensor lives, as ConversionResult.placements maps them by tensor id.

attribute

region

Python

helia_aot/views.py:264

region: int | None

The RegionView.id of the region holding the tensor, or None for a tensor with no elements, which has no region.