mindspore.ops.Minimum

class mindspore.ops.Minimum[源代码]

逐元素计算两个Tensor的最小值。

详情请查看 mindspore.ops.minimum()

支持平台:

Ascend GPU CPU

样例:

>>> # case 1 : same data type
>>> x = Tensor(np.array([1.0, 5.0, 3.0]), mindspore.float32)
>>> y = Tensor(np.array([4.0, 2.0, 6.0]), mindspore.float32)
>>> minimum = ops.Minimum()
>>> output = minimum(x, y)
>>> print(output)
[1. 2. 3.]
>>> # case 2 : different data type
>>> x = Tensor(np.array([1.0, 5.0, 3.0]), mindspore.int32)
>>> y = Tensor(np.array([4.0, 2.0, 6.0]), mindspore.float32)
>>> output = minimum(x, y)
>>> print(output.dtype)
Float32