IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /max/get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).

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.