mindspore.Tensor.argmax
- mindspore.Tensor.argmax(axis=None, keepdims=False)
详情请参考
mindspore.ops.argmax()
。- 支持平台:
Ascend
GPU
CPU
样例:
>>> import mindspore >>> import numpy as np >>> from mindspore import Tensor >>> input_x = Tensor(np.array([[1, 20, 5], [67, 8, 9], [130, 24, 15]]).astype(np.float32)) >>> output = input_x.argmax(output_type=mindspore.int32) >>> print(output)