tensor.argmin

   fn argmin(self: @Tensor<T>, axis: usize, keepdims: Option<bool>, select_last_index: Option<bool>) -> Tensor<usize>;

Returns the index of the minimum value along the specified axis.

Args

  • self(@Tensor<T>) - The input tensor.

  • axis(usize) - The axis along which to compute the argmin.

  • keepdims(Option<bool>) - If true, retains reduced dimensions with length 1. Defaults to true.

  • select_last_index(Option<bool>) - If true, the index of the last occurrence of the minimum value is returned. Defaults to false.

Panics

  • Panics if axis is not in the range of the input tensor's dimensions.

Returns

A new Tensor<T> instance containing the indices of the minimum values along the specified axis.

Examples

Case 1: argmin with default parameters

Case 2: argmin with keepdims set to false

Case 3: argmin with select_last_index set to true

Last updated