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).

Mojo function

to_tile_tensor

def to_tile_tensor[TensorType: DenseTensor, //, *, mut: Bool = False](tensor: TensorType) -> TileTensor[TensorType.dtype, TensorType.LayoutType, UntrackedOrigin[mut]]

Projects a dense tensor argument to a TileTensor view.

Parameters:

  • ​TensorType (DenseTensor): The dense tensor-argument type (inferred).
  • ​mut (Bool): Whether to project a mutable view (defaults to immutable).

Args:

  • ​tensor (TensorType): The dense tensor argument to project.

Returns:

TileTensor[TensorType.dtype, TensorType.LayoutType, UntrackedOrigin[mut]]: A TileTensor view over the argument's storage.

def to_tile_tensor[TensorType: DenseTensor & Output, //](tensor: TensorType) -> TileTensor[TensorType.dtype, TensorType.LayoutType, MutUntrackedOrigin]

Projects an output dense tensor argument to a mutable TileTensor view.

Output tensors are writable by construction, so the trait bound selects the mutable projection without call sites passing mut=True.

Parameters:

  • ​TensorType (DenseTensor & Output): The output dense tensor-argument type (inferred).

Args:

  • ​tensor (TensorType): The output dense tensor argument to project.

Returns:

TileTensor[TensorType.dtype, TensorType.LayoutType, MutUntrackedOrigin]: A mutable TileTensor view over the argument's storage.

def to_tile_tensor[TensorType: DenseTensor & MutableInput, //](tensor: TensorType) -> TileTensor[TensorType.dtype, TensorType.LayoutType, MutUntrackedOrigin]

Projects a mutable-input dense tensor argument to a mutable TileTensor.

Mutable inputs are read-write by construction, so the trait bound selects the mutable projection without call sites passing mut=True.

Parameters:

Args:

  • ​tensor (TensorType): The mutable-input dense tensor argument to project.

Returns:

TileTensor[TensorType.dtype, TensorType.LayoutType, MutUntrackedOrigin]: A mutable TileTensor view over the argument's storage.

Was this page helpful?