Skip to content

Commit f00e8b2

Browse files
Ignore type if for NumPy >= 2.0.0
1 parent 6035300 commit f00e8b2

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

dpnp/tests/helper.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,3 +248,7 @@ def has_support_aspect64(device=None):
248248
"""
249249
dev = dpctl.select_default_device() if device is None else device
250250
return dev.has_aspect_fp64
251+
252+
253+
def numpy_version():
254+
return numpy.lib.NumpyVersion(numpy.__version__)

dpnp/tests/third_party/cupy/statistics_tests/test_histogram.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import pytest
66

77
import dpnp as cupy
8-
from dpnp.tests.helper import has_support_aspect64
8+
from dpnp.tests.helper import has_support_aspect64, numpy_version
99
from dpnp.tests.third_party.cupy import testing
1010

1111
# Note that numpy.bincount does not support uint64 on 64-bit environment
@@ -474,7 +474,9 @@ def test_digitize_nd_bins(self):
474474
class TestHistogramdd:
475475
@testing.for_all_dtypes(no_bool=True, no_complex=True)
476476
@testing.numpy_cupy_allclose(
477-
atol=1e-3, rtol=1e-3, type_check=has_support_aspect64()
477+
atol=1e-3,
478+
rtol=1e-3,
479+
type_check=has_support_aspect64() and numpy_version() < "2.0.0",
478480
)
479481
def test_histogramdd(self, xp, dtype):
480482
x = testing.shaped_random((100, 3), xp, dtype, scale=100)

0 commit comments

Comments
 (0)