Skip to content

Commit 2e4612b

Browse files
committed
Add third party tests
1 parent 4f848a2 commit 2e4612b

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

dpnp/dpnp_iface_mathematical.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3762,7 +3762,7 @@ def real_if_close(a, tol=100):
37623762
Parameters
37633763
----------
37643764
x : {dpnp.ndarray, usm_ndarray}
3765-
Input array, expected to have floating-point type.
3765+
Input array, expected to have floating-point data type.
37663766
out : {None, dpnp.ndarray, usm_ndarray}, optional
37673767
Output array to populate.
37683768
Array must have the correct shape and the expected data type.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import unittest
2+
3+
import pytest
4+
5+
import dpnp as cupy
6+
from tests.third_party.cupy import testing
7+
8+
9+
class TestSpecial(unittest.TestCase):
10+
11+
@testing.for_dtypes(["e", "f", "d"])
12+
@testing.numpy_cupy_allclose(rtol=1e-3)
13+
def test_i0(self, xp, dtype):
14+
a = testing.shaped_random((2, 3), xp, dtype)
15+
return xp.i0(a)
16+
17+
@testing.for_dtypes(["e", "f", "d", "F", "D"])
18+
@testing.numpy_cupy_allclose(atol=1e-3)
19+
def test_sinc(self, xp, dtype):
20+
21+
if dtype in [cupy.float16, cupy.float32, cupy.complex64]:
22+
pytest.xfail(
23+
reason="XXX: np2.0: numpy 1.26 uses a wrong "
24+
"promotion; numpy 2.0 is OK"
25+
)
26+
27+
a = testing.shaped_random((2, 3), xp, dtype, scale=1)
28+
return xp.sinc(a)
29+
30+
@testing.for_dtypes(["e", "f", "d", "F", "D"])
31+
def test_sinc_zero(self, dtype):
32+
a = cupy.sinc(cupy.zeros(1, dtype=dtype))
33+
testing.assert_array_equal(a, cupy.ones(1, dtype=dtype))

0 commit comments

Comments
 (0)