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
slice_dim_as_view
def slice_dim_as_view[dtype: DType, dim: Int](tensor: TileTensor[dtype, Storage=tensor.Storage, address_space=tensor.address_space, linear_idx_type=tensor.linear_idx_type], start: Int, end: Int, step: Int) -> TileTensor[dtype, Layout[*?, *?], tensor.origin, address_space=tensor.address_space]
Returns a view of tensor sliced along a single dimension.
The returned view shares the underlying data with tensor but adjusts the
offset, stride, and extent of dim to reflect the normalized start,
end, and step range.
Args:
- βtensor (
TileTensor[dtype, Storage=tensor.Storage, address_space=tensor.address_space, linear_idx_type=tensor.linear_idx_type]): Source tensor to slice. - βstart (
Int): Starting index alongdim(negative values wrap from the end). - βend (
Int): Stopping index alongdim(exclusive; negative values wrap from the end). - βstep (
Int): Stride between selected indices alongdim; must be non-zero.
Returns:
TileTensor[dtype, Layout[*?, *?], tensor.origin, address_space=tensor.address_space]
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!