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

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:

Returns:

SIMD[dtype, simd_width]: A SIMD vector holding the computed range values for this tile.

Was this page helpful?