mindspore.mint.argmin

View Source On AtomGit
mindspore.mint.argmin(input, dim=None, keepdim=False)[source]

Return the indices of the minimum values of a tensor across a dimension.

Parameters
  • input (Tensor) – Input tensor.

  • dim (Union[int, None], optional) – Specify the dimension for computation. If None, compute all elements in the input . Default None.

  • keepdim (bool, optional) – Whether the output tensor has dim retained. Default False.

Returns

Tensor

Supported Platforms:

Ascend

Examples

>>> import mindspore
>>> import numpy as np
>>> x = mindspore.tensor(np.array([[1, 20, 5], [67, 8, 9], [130, 24, 15]]), mindspore.float32)
>>> output = mindspore.mint.argmin(x, dim=-1, keepdim=False)
>>> print(output)
[0 1 2]