mindspore/docs/api/api_python/ops/mindspore.ops.func_fmax.rst

27 lines
1.1 KiB
ReStructuredText
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

mindspore.ops.fmax
==================
.. py:function:: mindspore.ops.fmax(x1, x2)
逐元素计算输入Tensor的最大值。
.. math::
output_i = max(x1_i, x2_i)
.. note::
- 输入 `x1``x2` 遵循隐式转换法则使数据类型一致。
- 输入 `x1``x2` 的shape必须能相互广播。
- 如果其中一个比较值是NaN则返回另一个比较值。
参数:
- **x1** (Tensor) - 第一个输入Tensor支持的数据类型有 float16、float32、 float64、 int32、 int64。
- **x2** (Tensor) - 第二个输入Tensor支持的数据类型有 float16、 float32、 float64、 int32、 int64。
返回:
Tensor。其shape与两个输入广播之后的shape相同数据类型为隐式转换后精度较高的数据类型。
异常:
- **TypeError** - `x1``x2` 不是Tensor。
- **TypeError** - `x1``x2` 的数据类型不是以下数据类型之一float16、 float32、 float64、 int32、 int64。
- **ValueError** - `x1``x2` 的shape不能广播。