argmin

dragon.vm.tensorflow.math.argmin(
  input,
  axis=None,
  name=None
)[source]

Compute the index of minimum elements along the given axis.

The argument axis could be negative or None:

x = tf.constant([[1, 2, 3], [4, 5, 6]])

# A negative ``axis`` is the last-k axis
print(tf.math.argmin(x, 1))
print(tf.math.argmin(x, -1))  # Equivalent

# If ``axis`` is None, the vector-style reduction
# will be applied to return a scalar index
print(tf.math.argmin(x))
Parameters:
  • input (dragon.Tensor) – The input tensor.
  • axis (int, optional) – The axis to reduce.
  • name (str, optional) – The operation name.
Returns:

dragon.Tensor – The index of minimum elements.