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
arange
def arange[dtype: DType, simd_width: Int](start: Scalar[dtype], stop: Scalar[dtype], step: Scalar[dtype], index: IndexList[Int(1)]) -> SIMD[dtype, simd_width]
Computes a simd_width-wide vector of evenly-spaced values for the arange operation.
Returns start + (iota * step) where iota is seeded from the leading
index in index, producing one SIMD vector of the requested range.
Parameters:
- βdtype (
DType): Element type of the range values. - βsimd_width (
Int): Number of elements per SIMD vector.
Args:
- βstart (
Scalar[dtype]): First value of the range. - βstop (
Scalar[dtype]): Exclusive upper (or lower) bound of the range. - βstep (
Scalar[dtype]): Spacing between consecutive values. - βindex (
IndexList[Int(1)]): Per-element offset applied to the iota counter.
Returns:
SIMD[dtype, simd_width]: A SIMD vector holding the computed range values for this tile.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!