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_as_copy

def slice_as_copy[dtype: DType, index_type: DType](output: TileTensor[dtype, Storage=output.Storage, address_space=output.address_space, linear_idx_type=output.linear_idx_type], tensor: TileTensor[dtype, Storage=tensor.Storage, address_space=tensor.address_space, linear_idx_type=tensor.linear_idx_type], start: TileTensor[index_type, Storage=start.Storage, address_space=start.address_space, linear_idx_type=start.linear_idx_type], end: TileTensor[index_type, Storage=end.Storage, address_space=end.address_space, linear_idx_type=end.linear_idx_type], step: TileTensor[index_type, Storage=step.Storage, address_space=step.address_space, linear_idx_type=step.linear_idx_type], ctx: DeviceContext)

Copies a slice of tensor into output using the given start, end, and step indices.

The slice of tensor is materialized into output by loading from a temporary view and storing element-wise; output must have the same rank as tensor.

Args:

Was this page helpful?