argmin

dragon.math.argmin(
  inputs,
  axis=0,
  keepdims=False,
  **kwargs
)[source]

Compute the index of minimum elements along the given axis.

axis could be negative:

# A negative axis is the last-k axis
x = dragon.constant([[1, 2, 3], [4, 5, 6]])
print(dragon.math.argmin(x, axis=1))
print(dragon.math.argmin(x, axis=-1))  # Equivalent
Parameters:
  • inputs (dragon.Tensor) The input tensor.
  • axis (int, optional, default=0) The axis to reduce.
  • keepdims (bool, optional, default=False) Keep the reduced dimension or not.
Returns:

dragon.Tensor The index of minimum elements.