mindspore.ops.fmax

View Source On Gitee
mindspore.ops.fmax(input, other)[source]

Compute the maximum of input tensors element-wise.

outputi=max(x1i,x2i)

Note

  • Support implicit type conversion and type promotion.

  • Shapes of input and other should be able to broadcast.

  • If one of the elements to be compared is NaN, another element is returned.

Parameters
  • input (Tensor) – The first input.

  • other (Tensor) – The second input.

Returns

Tensor

Supported Platforms:

CPU

Examples

>>> import mindspore
>>> x1 = mindspore.tensor([1.0, 5.0, 3.0], mindspore.float32)
>>> x2 = mindspore.tensor([4.0, 2.0, 6.0], mindspore.float32)
>>> output = mindspore.ops.fmax(x1, x2)
>>> print(output)
[4. 5. 6.]