mindspore.ops.argsort
- mindspore.ops.argsort(input, axis=- 1, descending=False)[source]
Sorts the input tensor along the given dimension in specified order and return the sorted indices.
- Parameters
- Returns
Tensor, the indices of sorted input tensor. Data type is int32.
- Supported Platforms:
Ascend
GPU
CPU
Examples
>>> x = Tensor(np.array([[8, 2, 1], [5, 9, 3], [4, 6, 7]]), mindspore.float16) >>> sort = ops.argsort(x) >>> print(sort) [[2 1 0] [2 0 1] [0 1 2]]