mindspore.mint.min

View Source On Gitee
mindspore.mint.min(input) Tensor[source]

Return the minimum value of the input tensor.

Parameters

input (Tensor) – The input tensor.

Returns

Tensor

Supported Platforms:

Ascend

Examples

>>> import mindspore
>>> import numpy as np
>>> x = mindspore.tensor(np.array([0.0, 0.4, 0.6, 0.7, 0.1]), mindspore.float32)
>>> output = mindspore.mint.min(x)
>>> print(output)
0.0
mindspore.mint.min(input, dim, keepdim=False) Tensor[source]

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

Parameters
  • input (Tensor) – The input tensor.

  • dim (int) – Specify the dimension for computation.

  • keepdim (bool, optional) – Whether the output tensor has dim retained. Default False.

Returns

Tuple(min, min_indices) of 2 tensors.

Supported Platforms:

Ascend

Examples

>>> import mindspore
>>> import numpy as np
>>> x = mindspore.tensor(np.array([0.0, 0.4, 0.6, 0.7, 0.1]), mindspore.float32)
>>> output, index = mindspore.mint.min(x, 0, keepdim=True)
>>> print(output, index)
[0.] [0]
mindspore.mint.min(input, other) Tensor[source]

For details, please refer to mindspore.mint.minimum().