IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /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. /get-started.md).

Mojo function

reduce_argmin

def reduce_argmin[dtype: DType, InputFn: def[width: Int, alignment: Int, rank: Int](IndexList[rank]) -> SIMD[dtype, width] & RegisterPassable & ImplicitlyCopyable, OutputFn: def[width: SIMDLength, rank: Int](IndexList[rank], SIMD[DType.int64, width]) -> None & RegisterPassable & ImplicitlyCopyable, /, target: StringSpan[ImmStaticOrigin], *, reduce_dim: Int](input_fn: InputFn, output_fn: OutputFn, input_shape: Coord, context: Optional[DeviceContext] = None) where (eq InputFn.dtype, dtype)

Finds the argmin along reduce_dim via the Row layer: one ArgMin phase (native dtype, lower index wins ties) plus a per-row emit of the int64 index.