!49670 isclose supports list and tuple

Merge pull request !49670 from YingtongHu/master
This commit is contained in:
i-robot 2023-03-06 03:42:17 +00:00 committed by Gitee
commit 82ed9ac3fa
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 1 additions and 0 deletions

View File

@ -490,6 +490,7 @@ def isclose(a, b, rtol=1e-05, atol=1e-08, equal_nan=True):
>>> print(np.isclose(a, b, equal_nan=True)) >>> print(np.isclose(a, b, equal_nan=True))
[ True True False False True True] [ True True False False True True]
""" """
a, b = _to_tensor(a, b)
is_close = P.IsClose(rtol=rtol, atol=atol, equal_nan=equal_nan) is_close = P.IsClose(rtol=rtol, atol=atol, equal_nan=equal_nan)
return is_close(a, b) return is_close(a, b)