Skip to content

Commit 2074e4d

Browse files
committed
Update core_tests/test_ndarray_math.py
1 parent ec220d0 commit 2074e4d

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

dpnp/tests/third_party/cupy/core_tests/test_ndarray_math.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import numpy
44
import pytest
55

6+
import dpnp as cupy
67
from dpnp.tests.helper import has_support_aspect64
78
from dpnp.tests.third_party.cupy import testing
89

@@ -15,6 +16,7 @@
1516
)
1617
)
1718
class TestRound(unittest.TestCase):
19+
1820
shape = (20,)
1921

2022
@testing.for_all_dtypes()
@@ -33,8 +35,9 @@ def test_round(self, xp, dtype):
3335

3436
@testing.numpy_cupy_allclose(atol=1e-5)
3537
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+
)
3841
out = xp.empty_like(a)
3942
a.round(self.decimals, out)
4043
return out
@@ -51,6 +54,7 @@ def test_round_out(self, xp):
5154
)
5255
)
5356
class TestRoundHalfway(unittest.TestCase):
57+
5458
shape = (20,)
5559

5660
@testing.for_float_dtypes()
@@ -112,6 +116,7 @@ def test_round_halfway_uint(self, xp, dtype):
112116

113117
@testing.parameterize(*testing.product({"decimals": [-5, -4, -3, -2, -1, 0]}))
114118
class TestRoundMinMax(unittest.TestCase):
119+
115120
@unittest.skip("Known incompatibility: see core.pyx")
116121
@testing.numpy_cupy_array_equal()
117122
def _test_round_int64(self, xp):

0 commit comments

Comments
 (0)