11import unittest
22
3+ import numpy
4+
35from dpnp .tests .helper import has_support_aspect64
46from dpnp .tests .third_party .cupy import testing
57
68
79class 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 )
0 commit comments