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
Implemented traitsβ
AnyType,
ImplicitlyDestructible
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[Input, static_spec=input.static_spec], starts: ManagedTensorSlice[Input, static_spec=starts.static_spec], stops: ManagedTensorSlice[Input, static_spec=stops.static_spec], steps: ManagedTensorSlice[Input, static_spec=steps.static_spec]) -> ManagedTensorSlice[Input, static_spec=input.static_spec.with_tile_layout_and_alignment[rank, Layout[*?, *?]](Slice.get_view_alignment[rank, dtype, StaticTensorSpec[dtype, rank, input.static_spec.static_layout, input.static_spec.InFusion, input.static_spec.OutFusion, input.static_spec.ComputeFusion, input.static_spec.ComputeFusionTile].strides_tuple, static_starts, static_steps](ManagedTensorSlice[Input, static_spec=input.static_spec].alignment))]
Returns:
executeβ
static def execute[target: StringSlice[StaticConstantOrigin], _trace_name: StringSlice[StaticConstantOrigin], static_starts: IntTuple, static_steps: IntTuple, dtype: DType, rank: Int](output: ManagedTensorSlice[Output, static_spec=output.static_spec], input: ManagedTensorSlice[Input, static_spec=input.static_spec], starts: ManagedTensorSlice[Input, static_spec=starts.static_spec], stops: ManagedTensorSlice[Input, static_spec=stops.static_spec], steps: ManagedTensorSlice[Input, static_spec=steps.static_spec], ctx: DeviceContext)
shapeβ
static def shape(input: ManagedTensorSlice[Input, static_spec=input.static_spec], starts: ManagedTensorSlice[Input, static_spec=starts.static_spec], stops: ManagedTensorSlice[Input, static_spec=stops.static_spec], steps: ManagedTensorSlice[Input, static_spec=steps.static_spec]) -> IndexList[input.static_spec.rank]
Returns:
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!