Skip to content

Commit 22c04a5

Browse files
committed
fix test_elementwise
1 parent 22041d8 commit 22c04a5

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

dpnp/dpnp_algo/dpnp_elementwise_common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ def __call__(self, x, decimals=0, out=None, dtype=None):
595595

596596
out_usm = None if out is None else dpnp.get_usm_ndarray(out)
597597
# the output of x_usm multiplied by 10^decimals should be
598-
# float avoid overflow for integer dtypes
598+
# float to avoid overflow for integer dtypes
599599
x_usm = dpt.multiply(x_usm, float(10**decimals))
600600
x_usm = dpt.round(x_usm, out=out_usm)
601601
res_usm = dpt.divide(x_usm, 10**decimals, out=out_usm)

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def test_large_int_upper_2(self, xp, dtype):
110110
if xp.issubdtype(dtype, xp.unsignedinteger) or flag:
111111
pytest.skip("numpy doesn't raise OverflowError")
112112

113-
if dtype == xp.int8 and is_win_platform():
113+
if dtype in [xp.int8, xp.intc] and is_win_platform():
114114
pytest.skip("numpy promotes dtype differently")
115115

116116
a = xp.array([1], dtype=xp.int8)
@@ -160,12 +160,11 @@ def test_large_int_lower_1(self, xp, dtype):
160160
if dtype in [xp.int16, xp.int32, xp.int64, xp.longlong]:
161161
pytest.skip("numpy doesn't raise OverflowError")
162162

163-
if dtype == xp.int8 and is_win_platform():
163+
if dtype in [xp.int8, xp.intc] and is_win_platform():
164164
pytest.skip("numpy promotes dtype differently")
165165

166166
a = xp.array([0], dtype=xp.int8)
167167
b = xp.iinfo(dtype).min
168-
res = a + b
169168
return a + b
170169

171170
@testing.for_int_dtypes(no_bool=True)
@@ -175,7 +174,7 @@ def test_large_int_lower_2(self, xp, dtype):
175174
if dtype in [xp.int16, xp.int32, xp.int64, xp.longlong]:
176175
pytest.skip("numpy doesn't raise OverflowError")
177176

178-
if dtype == xp.int8 and is_win_platform():
177+
if dtype in [xp.int8, xp.intc] and is_win_platform():
179178
pytest.skip("numpy promotes dtype differently")
180179

181180
a = xp.array([-1], dtype=xp.int8)

0 commit comments

Comments
 (0)