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:
- βTensorType (
DenseTensor&MutableInput): The mutable-input dense tensor-argument type (inferred).
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?
Thank you! We'll create more content like this.
Thank you for helping us improve!