Skip to content

Commit 93fd1fb

Browse files
authored
Backport gh-2483 (#2493)
This PR backports of #2483 from development branch to `maintenance/0.18.x`.
1 parent 20d28e6 commit 93fd1fb

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

dpnp/tests/third_party/cupy/math_tests/test_hyperbolic.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,24 @@
11
import unittest
22

3+
import numpy
4+
35
from dpnp.tests.helper import has_support_aspect64
46
from dpnp.tests.third_party.cupy import testing
57

68

79
class TestHyperbolic(unittest.TestCase):
810

911
@testing.for_all_dtypes()
10-
@testing.numpy_cupy_allclose(atol=1e-5, type_check=has_support_aspect64())
12+
@testing.numpy_cupy_allclose(
13+
atol={numpy.float16: 1e-3, "default": 1e-5},
14+
type_check=has_support_aspect64(),
15+
)
1116
def check_unary(self, name, xp, dtype):
1217
a = testing.shaped_arange((2, 3), xp, dtype)
1318
return getattr(xp, name)(a)
1419

1520
@testing.for_dtypes(["e", "f", "d"])
16-
@testing.numpy_cupy_allclose(atol=1e-5)
21+
@testing.numpy_cupy_allclose(atol={numpy.float16: 1e-3, "default": 1e-5})
1722
def check_unary_unit(self, name, xp, dtype):
1823
a = xp.array([0.2, 0.4, 0.6, 0.8], dtype=dtype)
1924
return getattr(xp, name)(a)
@@ -31,7 +36,7 @@ def test_arcsinh(self):
3136
self.check_unary("arcsinh")
3237

3338
@testing.for_dtypes(["e", "f", "d"])
34-
@testing.numpy_cupy_allclose(atol=1e-5)
39+
@testing.numpy_cupy_allclose(atol={numpy.float16: 1e-3, "default": 1e-5})
3540
def test_arccosh(self, xp, dtype):
3641
a = xp.array([1, 2, 3], dtype=dtype)
3742
return xp.arccosh(a)

dpnp/tests/third_party/cupy/math_tests/test_trigonometric.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import unittest
22

3+
import numpy
34
import pytest
45

56
from dpnp.tests.helper import has_support_aspect64
@@ -24,7 +25,7 @@ def check_binary(self, name, xp, dtype):
2425
return getattr(xp, name)(a, b)
2526

2627
@testing.for_dtypes(["e", "f", "d"])
27-
@testing.numpy_cupy_allclose(atol=1e-5)
28+
@testing.numpy_cupy_allclose(atol={numpy.float16: 1e-3, "default": 1e-5})
2829
def check_unary_unit(self, name, xp, dtype):
2930
a = xp.array([0.2, 0.4, 0.6, 0.8], dtype=dtype)
3031
return getattr(xp, name)(a)

0 commit comments

Comments
 (0)