# helia_aot.memory.defines.TensorBinding

## helia_aot.memory.defines.TensorBinding

`class` · `python`

```python
TensorBinding()
```

Planner's emit intent for a single tensor's storage.

Provisional: importable, but outside the compatibility promise; a minor release can change or remove it.

Every tensor in a :class:`MemoryPlan` is bound to an arena slot at
``(role, memory, offset)``. There are no per-tensor C symbols
anymore — scratch, persistent, and constant tensors are all
descriptors against arena buffers exposed via
``arena_buffers[region]``.

Constant arenas come in two shapes, distinguished purely by
whether ``source_memory`` matches ``memory``:

- **Cold** (``source_memory == memory``): the arena buffer itself
  is a ``static const`` blob in cold storage. Kernels read it
  directly; no hydration is required.
- **Staged** (``source_memory != memory``): the arena buffer is a
  writable runtime copy in ``memory``; a separate read-only
  source blob lives in ``source_memory`` and the caller (or the
  weak ``<prefix>_hydrate_constants`` helper) copies it in
  before the first ``model_run``.

Scratch and persistent bindings always have
``source_memory == memory`` (they are writable arenas with no
cold-storage source).

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

### helia_aot.memory.defines.TensorBinding.role

`attribute` · `python`

```python
role: ArenaRole = Field(..., description='Logical role of the storage region.')
```

Logical role of the storage region.

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

### helia_aot.memory.defines.TensorBinding.memory

`attribute` · `python`

```python
memory: MemoryType = Field(..., description='Runtime memory of the arena slot.')
```

Runtime (kernel-visible) memory of the
arena slot.

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

### helia_aot.memory.defines.TensorBinding.source_memory

`attribute` · `python`

```python
source_memory: MemoryType = Field(..., description='Cold-storage memory the slot is sourced from.')
```

Cold-storage memory the slot is
sourced from. Equals ``memory`` for scratch, persistent,
and cold constants; differs from ``memory`` for staged
constants.

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

### helia_aot.memory.defines.TensorBinding.offset

`attribute` · `python`

```python
offset: int = Field(default=0, description='Byte offset within the arena.')
```

Byte offset within the arena.

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