|
| 1 | +from __future__ import annotations |
| 2 | + |
1 | 3 | import warnings |
2 | 4 |
|
3 | 5 | import numpy |
4 | 6 | import pytest |
5 | 7 |
|
6 | 8 | import dpnp as cupy |
| 9 | + |
| 10 | +# import cupy._core._accelerator as _acc |
| 11 | +# from cupy import cuda |
7 | 12 | from dpnp.tests.third_party.cupy import testing |
8 | 13 |
|
9 | 14 | _all_methods = ( |
10 | 15 | # 'inverted_cdf', # TODO(takagi) Not implemented |
11 | 16 | # 'averaged_inverted_cdf', # TODO(takagi) Not implemented |
12 | 17 | # 'closest_observation', # TODO(takagi) Not implemented |
13 | 18 | # 'interpolated_inverted_cdf', # TODO(takagi) Not implemented |
14 | | - # 'hazen', # TODO(takagi) Not implemented |
15 | | - # 'weibull', # TODO(takagi) Not implemented |
| 19 | + "hazen", |
| 20 | + "weibull", |
16 | 21 | "linear", |
17 | | - # 'median_unbiased', # TODO(takagi) Not implemented |
18 | | - # 'normal_unbiased', # TODO(takagi) Not implemented |
| 22 | + "median_unbiased", |
| 23 | + "normal_unbiased", |
19 | 24 | "lower", |
20 | 25 | "higher", |
21 | 26 | "midpoint", |
@@ -166,9 +171,8 @@ def test_percentile_out_of_range_q(self, dtype, method): |
166 | 171 | with pytest.raises(ValueError): |
167 | 172 | xp.percentile(a, q, axis=-1, method=method) |
168 | 173 |
|
169 | | - @testing.for_all_dtypes() |
170 | 174 | @testing.for_all_dtypes(no_float16=True, no_bool=True, no_complex=True) |
171 | | - @testing.numpy_cupy_allclose() |
| 175 | + @testing.numpy_cupy_allclose(rtol=1e-6) |
172 | 176 | def test_quantile_defaults(self, xp, dtype, method): |
173 | 177 | a = testing.shaped_random((2, 3, 8), xp, dtype) |
174 | 178 | q = testing.shaped_random((3,), xp, scale=1) |
@@ -391,12 +395,16 @@ def test_ptp_axis2(self, xp, dtype): |
391 | 395 | @testing.for_float_dtypes() |
392 | 396 | @testing.numpy_cupy_allclose() |
393 | 397 | def test_ptp_nan(self, xp, dtype): |
| 398 | + # if _acc.ACCELERATOR_CUTENSOR in _acc.get_routine_accelerators(): |
| 399 | + # pytest.skip() |
394 | 400 | a = xp.array([float("nan"), 1, -1], dtype) |
395 | 401 | return xp.ptp(a) |
396 | 402 |
|
397 | 403 | @testing.for_float_dtypes() |
398 | 404 | @testing.numpy_cupy_allclose() |
399 | 405 | def test_ptp_all_nan(self, xp, dtype): |
| 406 | + # if _acc.ACCELERATOR_CUTENSOR in _acc.get_routine_accelerators(): |
| 407 | + # pytest.skip() |
400 | 408 | a = xp.array([float("nan"), float("nan")], dtype) |
401 | 409 | return xp.ptp(a) |
402 | 410 |
|
|
0 commit comments