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 struct
Slice
struct Slice
Registers the mo.slice graph op with the graph compiler.
Implemented traitsβ
Methodsβ
get_view_alignmentβ
static def get_view_alignment[rank: Int, dtype: DType, input_strides: IntTuple, static_starts: IntTuple, static_steps: IntTuple](input_alignment: Int) -> Int
Returns:
update_input_viewβ
static def update_input_view[dtype: DType, rank: Int, //, output_static_shape: IntTuple, static_starts: IntTuple, static_steps: IntTuple](input: ManagedTensorSlice[IOSpec[_, _].Input, static_spec=input.static_spec], starts: ManagedTensorSlice[IOSpec[_, _].Input, static_spec=starts.static_spec], stops: ManagedTensorSlice[IOSpec[_, _].Input, static_spec=stops.static_spec], steps: ManagedTensorSlice[IOSpec[_, _].Input, static_spec=steps.static_spec]) -> ManagedTensorSlice[IOSpec[_, _].Input, static_spec=input.static_spec.with_tile_layout_and_alignment[rank, Layout[*?, *?]](Slice.get_view_alignment[rank, dtype, coord_to_int_tuple[input.static_spec.static_layout._stride_types](), static_starts, static_steps](input.static_spec.alignment))]
Returns:
executeβ
static def execute[target: StringSlice[ImmStaticOrigin], _trace_name: StringSlice[ImmStaticOrigin], static_starts: IntTuple, static_steps: IntTuple, dtype: DType, rank: Int](output: ManagedTensorSlice[IOSpec[_, _].Output, static_spec=output.static_spec], input: ManagedTensorSlice[IOSpec[_, _].Input, static_spec=input.static_spec], starts: ManagedTensorSlice[IOSpec[_, _].Input, static_spec=starts.static_spec], stops: ManagedTensorSlice[IOSpec[_, _].Input, static_spec=stops.static_spec], steps: ManagedTensorSlice[IOSpec[_, _].Input, static_spec=steps.static_spec], ctx: DeviceContext)
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!