mindspore.ops.msort
- mindspore.ops.msort(input)[源代码]
返回沿第一个维度对输入tensor进行升序排序后的tensor。
ops.msort(input) 等价于 ops.sort(axis=0)(input)[0]。更多信息请参考
mindspore.ops.sort()
。- 参数:
input (Tensor) - 输入tensor。
- 返回:
Tensor
- 支持平台:
Ascend
GPU
CPU
样例:
>>> import mindspore >>> input = mindspore.tensor([[8, 2, 1], ... [5, 9, 3], ... [4, 6, 7]]) >>> mindspore.ops.msort(input) Tensor(shape=[3, 3], dtype=Int64, value= [[4, 2, 1], [5, 6, 3], [8, 9, 7]]) >>> # is equivalent to `ops.sort(axis=0)(input)[0]` >>> mindspore.ops.sort(input, axis=0)[0] Tensor(shape=[3, 3], dtype=Int64, value= [[4, 2, 1], [5, 6, 3], [8, 9, 7]])