3
3
import numpy
4
4
import pytest
5
5
6
+ import dpnp as cupy
6
7
from dpnp .tests .helper import has_support_aspect64
7
8
from dpnp .tests .third_party .cupy import testing
8
9
15
16
)
16
17
)
17
18
class TestRound (unittest .TestCase ):
19
+
18
20
shape = (20 ,)
19
21
20
22
@testing .for_all_dtypes ()
@@ -33,8 +35,9 @@ def test_round(self, xp, dtype):
33
35
34
36
@testing .numpy_cupy_allclose (atol = 1e-5 )
35
37
def test_round_out (self , xp ):
36
- dtype = "d" if has_support_aspect64 () else "f"
37
- a = testing .shaped_random (self .shape , xp , scale = 100 , dtype = dtype )
38
+ a = testing .shaped_random (
39
+ self .shape , xp , scale = 100 , dtype = cupy .default_float_type ()
40
+ )
38
41
out = xp .empty_like (a )
39
42
a .round (self .decimals , out )
40
43
return out
@@ -51,6 +54,7 @@ def test_round_out(self, xp):
51
54
)
52
55
)
53
56
class TestRoundHalfway (unittest .TestCase ):
57
+
54
58
shape = (20 ,)
55
59
56
60
@testing .for_float_dtypes ()
@@ -112,6 +116,7 @@ def test_round_halfway_uint(self, xp, dtype):
112
116
113
117
@testing .parameterize (* testing .product ({"decimals" : [- 5 , - 4 , - 3 , - 2 , - 1 , 0 ]}))
114
118
class TestRoundMinMax (unittest .TestCase ):
119
+
115
120
@unittest .skip ("Known incompatibility: see core.pyx" )
116
121
@testing .numpy_cupy_array_equal ()
117
122
def _test_round_int64 (self , xp ):
0 commit comments