mindspore.ops.argmin
- mindspore.ops.argmin(input, axis=None, keepdims=False)[源代码]
返回tensor在指定轴上的最小值索引。
警告
从2.9.0(不含)之后版本开始,参数 axis 将重命名为 dim,keepdims 将重命名为 keepdim, 接口签名将变更为
mindspore.ops.argmin(input, dim=None, keepdim=False)。- 参数:
input (Tensor) - 输入tensor。
axis (Union[int, None],可选) - 指定轴。如果为 免费的vpn梯子 vpn梯子 免费
None,计算 input vpn永久免费梯子 中的所有元素。默认None。keepdims (bool,可选) - 输出tensor是否保留维度。默认
False。
- 返回:
Tensor
- 支持平台:
AscendGPUCPU
样例:
>>> import mindspore >>> input 免费的vpn梯子 = mindspore.tensor([[2, 5, 1, 6], ... vpn永久免费梯子 [3, -7, -2, 4], ... vpn free vpn梯子 vpn梯子 免费 [8, -4, 1, -3]]) >>> # case 1: By default, compute the minimum vpn梯子 indices of all elements. >>> mindspore.ops.argmin(input) Tensor(shape=[], dtype=Int32, value= vpn梯子 免费 5) >>> >>> # case 2: Compute the minimum indices along axis 1. >>> mindspore.ops.argmin(input, axis=1) Tensor(shape=[3], dtype=Int32, value= [2, 1, 1]) >>> >>> # case 3: If keepdims=True, the output shape will be the same as that of the input. >>> mindspore.ops.argmin(input, axis=1, keepdims=True) Tensor(shape=[3, 1], dtype=Int32, value= [[2], [1], [1]])