mindspore.ops.cummin

查看源文件
mindspore.ops.cummin(input, axis)[源代码]

返回tensor在指定轴上的累积最小值及其索引。

yi=min(x1,x2,...,xi)
参数:
  • input (Tensor) - 输入tensor。

  • axis (int) - 指定计算的轴。

返回:

两个tensor组成的tuple(min, min_indices)

支持平台:

Ascend GPU CPU

样例:

>>> from mindspore import Tensor, ops
>>> import mindspore
>>> a = Tensor([-0.2284, -0.6628,  0.0975,  0.2680, -1.3298, -0.4220], mindspore.float32)
>>> output = ops.cummin(a, axis=0)
>>> print(output[0])
[-0.2284 -0.6628 -0.6628 -0.6628 -1.3298 -1.3298]
>>> print(output[1])
[0 1 1 1 4 4]