# helia_aot.memory.defines.TensorAttributes

## helia_aot.memory.defines.TensorAttributes

`class` · `python`

```python
TensorAttributes()
```

This class provides the baseline set of tensor attribute rules.

Source: `helia_aot/memory/defines.py:488`

### helia_aot.memory.defines.TensorAttributes.memory

`attribute` · `python`

```python
memory: MemoryType | None = Field(default=None, description='Memory placement for tensors; None lets the planner choose')
```

Memory placement for tensors. For
constants this is the **source** (cold-storage) memory
where the tensor's bytes live in the image. When
``constant_destination_memory`` is set and differs from
``memory``, the runtime arena lives in that destination
memory and a hydration copy is required; otherwise the
arena lives in ``memory`` itself and is read-only (cold).
When ``None`` (default), no rule pins the tensor and the
planner chooses the memory, as it does for a tensor no rule
matches; for a staged constant it chooses the source memory.

Source: `helia_aot/memory/defines.py:522`

### helia_aot.memory.defines.TensorAttributes.constant_destination_memory

`attribute` · `python`

```python
constant_destination_memory: MemoryType | None = Field(default=None, description='Per-tensor runtime destination memory for constants. When None (default) the constant is read in place from its source memory; when set the constant is hydrated into a writable arena slot in the destination memory.')
```

Override the
runtime (kernel-visible) memory for a constant. Required
only when the runtime memory must differ from the source
memory (e.g. weights stored in MRAM but read from
DTCM/SRAM at runtime). When ``None`` (default), the
runtime memory equals ``memory`` and no hydration step
is needed. Must reference a writable memory of the
target platform when set.

Source: `helia_aot/memory/defines.py:525`

### helia_aot.memory.defines.TensorAttributes.residency

`attribute` · `python`

```python
residency: Residency | None = Field(default=None, description="How a constant reaches its readers: direct (read in place), pin (copied once at init into constant_destination_memory) or stream (permits streaming: copied into the stream pool before its first reader when the plan's schedule names it, otherwise direct). constant_destination_memory implies pin.")
```

How a constant reaches the operators
that read it: ``direct`` (read in place), ``pin`` (copied once
at init into ``constant_destination_memory``, which it requires)
or ``stream`` (permits streaming: copied into the stream pool
before its first reader when the plan's schedule names it,
otherwise ``direct``). Setting ``constant_destination_memory``
implies ``pin`` at the same rule's precedence; one rule cannot
pair it with ``direct`` or ``stream``. Applies to constants only.

Source: `helia_aot/memory/defines.py:534`
