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

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:

Returns:

TileTensor[dtype, Layout[*?, *?], tensor.origin, address_space=tensor.address_space]

Was this page helpful?