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

copy_to_slice

def copy_to_slice[dtype: DType, start_type: DType, end_type: DType, step_type: DType, target: StringSlice[ImmStaticOrigin] = StringSlice("cpu")](buffer: TileTensor[dtype, Storage=buffer.Storage, address_space=buffer.address_space, linear_idx_type=buffer.linear_idx_type], in_slice: TileTensor[dtype, Storage=in_slice.Storage, address_space=in_slice.address_space, linear_idx_type=in_slice.linear_idx_type], start: TileTensor[start_type, Storage=start.Storage, address_space=start.address_space, linear_idx_type=start.linear_idx_type], end: TileTensor[end_type, Storage=end.Storage, address_space=end.address_space, linear_idx_type=end.linear_idx_type], step: TileTensor[step_type, Storage=step.Storage, address_space=step.address_space, linear_idx_type=step.linear_idx_type], context: DeviceContext)

Copies in_slice into the slice of buffer defined by start, end, and step.

The shape of in_slice must match the shape produced by slicing buffer with the given indices; otherwise an error is raised. The copy is performed element-wise over the sliced view of buffer.

Args:

Was this page helpful?