mindspore/docs/api/api_python/mint/mindspore.mint.func_isclose...

22 lines
887 B
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.mint.isclose
=======================
.. py:function:: mindspore.mint.isclose(input, other, rtol=1e-05, atol=1e-08, equal_nan=False)
返回一个布尔型tensor表示两个tensor在容忍度内是否逐元素相等。数学公式为
.. math::
|input-other| ≤ atol + rtol × |other|
如果inf值具有相同的符号则认为它们相等如果 `equal_nan```True`` NaN值被认为相等 。
参数:
- **input** (Tensor) - 第一个输入tensor。
- **other** (Tensor) - 第二个输入tensor数据类型和shape必须与 `input` 相同。
- **rtol** (Union[float, int, bool], 可选) - 相对容忍度。
- **atol** (Union[float, int, bool], 可选) - 绝对容忍度。
- **equal_nan** (bool, 可选) - 若为 ``True`` 则两个NaN被视为相等。
返回:
Tensor