IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /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. /get-started.md).

Mojo function

stable_tile_tensor

def stable_tile_tensor[LayoutType: TensorLayout, //, dtype: DType](addr: StableAddr, layout: LayoutType) -> TileTensor[dtype, LayoutType, MutUntrackedOrigin, Engine=StableAddrEngine]

Builds a StableAddrEngine-backed TileTensor over a stable address slot.

The result can be constructed, tiled, and sliced on the host and passed to a kernel; loads and stores are device only. A graph recorded against a kernel that consumes the tensor bakes in the slot, so DeviceGraphBuilder.place_stable() can retarget the tensor before each replay without the graph being rebuilt. Nothing keeps the slot alive on the tile's behalf; they are assumed to live for the entire graph forward pass.

Parameters:

  • ​LayoutType (TensorLayout): The layout type, inferred from layout.
  • ​dtype (DType): The element data type of the tensor.

Args:

  • ​addr (StableAddr): The stable address slot holding the tensor's data pointer.
  • ​layout (LayoutType): The layout of the tensor.

Returns:

TileTensor[dtype, LayoutType, MutUntrackedOrigin, Engine=StableAddrEngine]: A slot-backed tile tensor at element offset zero.

Was this page helpful?