Skip to main content

Mojo function

argmaxmin_gpu

argmaxmin_gpu[dtype: DType, output_type: DType, largest: Bool](ctx: DeviceContext, input: TileTensor[dtype, input.LayoutType, input.origin, address_space=input.address_space, linear_idx_type=input.linear_idx_type, element_size=input.element_size], output: TileTensor[output_type, output.LayoutType, output.origin, address_space=output.address_space, linear_idx_type=output.linear_idx_type, element_size=output.element_size])

Wraps the Top-K GPU kernel with K=1 to perform argmax on the inner-most dimension.

Parameters:

  • โ€‹dtype (DType): DType - The data dtype of the input tensor.
  • โ€‹output_type (DType): DType - The data dtype of the output tensor.
  • โ€‹largest (Bool): Bool - Whether to perform argmax or argmin.

Was this page helpful?