mindspore.ops.cummin

mindspore.ops.cummin(input, axis)[source]

Return the cumulative minimum values and their indices along the given axis of the tensor.

\[\begin{split}\begin{array}{ll} \\ y_{i} = \min(x_{1}, x_{2}, ... , x_{i}) \end{array}\end{split}\]
Parameters
  • input (Tensor) – The input tensor.

  • axis (int) – Specify the axis for computation.

Returns

Tuple(min, min_indices) of 2 tensors.

Supported Platforms:

Ascend GPU CPU

Examples

>>> 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]