1
1
import unittest
2
2
3
+ import numpy
4
+
3
5
from dpnp .tests .helper import has_support_aspect64
4
6
from dpnp .tests .third_party .cupy import testing
5
7
6
8
7
9
class TestHyperbolic (unittest .TestCase ):
8
10
9
11
@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
+ )
11
16
def check_unary (self , name , xp , dtype ):
12
17
a = testing .shaped_arange ((2 , 3 ), xp , dtype )
13
18
return getattr (xp , name )(a )
14
19
15
20
@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 } )
17
22
def check_unary_unit (self , name , xp , dtype ):
18
23
a = xp .array ([0.2 , 0.4 , 0.6 , 0.8 ], dtype = dtype )
19
24
return getattr (xp , name )(a )
@@ -31,7 +36,7 @@ def test_arcsinh(self):
31
36
self .check_unary ("arcsinh" )
32
37
33
38
@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 } )
35
40
def test_arccosh (self , xp , dtype ):
36
41
a = xp .array ([1 , 2 , 3 ], dtype = dtype )
37
42
return xp .arccosh (a )
0 commit comments