Skip to main content

Python class

RealizationState

RealizationState

class max.experimental.tensor.RealizationState(values, ctx)

source

Bases: object

State for an unrealized tensor.

values is always a tuple of GraphValue — one entry for an unsharded tensor, N entries (one per shard) for a sharded tensor. All values live in the same graph and realization context, which guarantees atomic realization: all shards compile and execute together.

See RealizationContext.

Parameters:

ctx

ctx: RealizationContext

source

The realization context used to create this tensor. This context is responsible for realizing the tensor to a real value.

num_values

property num_values: int

source

Returns the number of graph values (1 for unsharded, N for sharded).

value

property value: BufferValue | TensorValue

source

Returns the single graph value. Raises if this is a sharded state.

values

values: tuple[BufferValue | TensorValue, ...]

source

The symbolic value(s) representing the computation backing this tensor. Always a tuple: length-1 for unsharded, length-N for sharded.