mindspore.ops.cummin

mindspore.ops.cummin(input, axis)[源代码]

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

\[\begin{split}\begin{array}{ll} \\ y_{i} = \min(x_{1}, x_{2}, ... , x_{i}) \end{array}\end{split}\]

警告

从2.9.0(不含)之后版本开始,该接口将发生非兼容性变更:参数 axis 将重命名为 dim

变更后的接口签名为 mindspore.ops.cummin(input, dim)

参数:
  • 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]