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 module

slice

Implements the ONNX Slice operator, selecting sub-tensors along specified axes with start, stop, and step.

Functions​

  • ​copy_to_slice: Copies in_slice into the slice of buffer defined by start, end, and step.
  • ​slice_as_copy: Copies a slice of tensor into output using the given start, end, and step indices.
  • ​slice_as_view: Returns a view of tensor sliced along every dimension.
  • ​slice_dim_as_view: Returns a view of tensor sliced along a single dimension.
  • ​slice_shape: Computes the shape that results from slicing input_buf with the given start, stop, and step tensors.
  • ​sliced_add: Adds tensors a and b element-wise for rows < lora_end_idx, otherwise copies a.