Skip to content

Commit 5daa7e9

Browse files
vtavanaantonwolfy
andauthored
remove w/a related to dpctl-issue-2030 (#2403)
Removes w/a related to IntelPython/dpctl#2030. --------- Co-authored-by: Anton <[email protected]>
1 parent 777bc73 commit 5daa7e9

File tree

3 files changed

+6
-27
lines changed

3 files changed

+6
-27
lines changed

Diff for: dpnp/dpnp_iface_mathematical.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ def around(x, /, decimals=0, out=None):
611611
Parameters
612612
----------
613613
x : {dpnp.ndarray, usm_ndarray}
614-
Input array, expected to have a real-valued data type.
614+
Input array, expected to have a boolean or real-valued data type.
615615
out : {None, dpnp.ndarray, usm_ndarray}, optional
616616
Output array to populate.
617617
Array must have the correct shape and the expected data type.
@@ -791,6 +791,7 @@ def clip(a, /, min=None, max=None, *, out=None, order="K", **kwargs):
791791

792792
conj = conjugate
793793

794+
794795
_COPYSIGN_DOCSTRING = """
795796
Composes a floating-point value with the magnitude of `x1_i` and the sign of
796797
`x2_i` for each element of input arrays `x1` and `x2`.
@@ -1717,7 +1718,7 @@ def ediff1d(ary, to_end=None, to_begin=None):
17171718
Parameters
17181719
----------
17191720
x : {dpnp.ndarray, usm_ndarray}
1720-
Input array, expected to have a real-valued data type.
1721+
Input array, expected to have a boolean or real-valued data type.
17211722
out : {None, dpnp.ndarray, usm_ndarray}, optional
17221723
Output array to populate.
17231724
Array must have the correct shape and the expected data type.
@@ -1878,7 +1879,7 @@ def ediff1d(ary, to_end=None, to_begin=None):
18781879
Parameters
18791880
----------
18801881
x : {dpnp.ndarray, usm_ndarray}
1881-
Input array, expected to have a real-valued data type.
1882+
Input array, expected to have a boolean or real-valued data type.
18821883
out : {None, dpnp.ndarray, usm_ndarray}, optional
18831884
Output array to populate.
18841885
Array must have the correct shape and the expected data type.
@@ -4551,7 +4552,7 @@ def trapezoid(y, x=None, dx=1.0, axis=-1):
45514552
Parameters
45524553
----------
45534554
x : {dpnp.ndarray, usm_ndarray}
4554-
Input array, expected to have a real-valued data type.
4555+
Input array, expected to have a boolean or real-valued data type.
45554556
out : {None, dpnp.ndarray, usm_ndarray}, optional
45564557
Output array to populate.
45574558
Array must have the correct shape and the expected data type.

Diff for: dpnp/tests/test_mathematical.py

+1-21
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
get_integer_float_dtypes,
3333
has_support_aspect16,
3434
has_support_aspect64,
35-
is_gpu_device,
3635
numpy_version,
3736
)
3837
from .third_party.cupy import testing
@@ -2178,25 +2177,11 @@ def test_out(self, func, dt_in, dt_out):
21782177
if dt_in != dt_out:
21792178
if numpy.can_cast(dt_in, dt_out, casting="same_kind"):
21802179
# NumPy allows "same_kind" casting, dpnp does not
2181-
if (
2182-
func != "fix"
2183-
and dt_in == dpnp.bool
2184-
and dt_out == dpnp.int8
2185-
and is_gpu_device()
2186-
):
2187-
# TODO: get rid of w/a when dpctl#2030 is fixed
2188-
pass
2189-
else:
2190-
assert_raises(ValueError, getattr(dpnp, func), ia, out=iout)
2180+
assert_raises(ValueError, getattr(dpnp, func), ia, out=iout)
21912181
else:
21922182
assert_raises(ValueError, getattr(dpnp, func), ia, out=iout)
21932183
assert_raises(TypeError, getattr(numpy, func), a, out=out)
21942184
else:
2195-
if func != "fix" and dt_in == dpnp.bool and is_gpu_device():
2196-
# TODO: get rid of w/a when dpctl#2030 is fixed
2197-
out = out.astype(numpy.int8)
2198-
iout = iout.astype(dpnp.int8)
2199-
22002185
expected = getattr(numpy, func)(a, out=out)
22012186
result = getattr(dpnp, func)(ia, out=iout)
22022187
assert result is iout
@@ -2222,11 +2207,6 @@ def test_out_usm_ndarray(self, func, dt):
22222207
out = numpy.empty(a.shape, dtype=dt)
22232208
ia, usm_out = dpnp.array(a), dpt.asarray(out)
22242209

2225-
if func != "fix" and dt == dpnp.bool and is_gpu_device():
2226-
# TODO: get rid of w/a when dpctl#2030 is fixed
2227-
out = out.astype(numpy.int8)
2228-
usm_out = dpt.asarray(usm_out, dtype=dpnp.int8)
2229-
22302210
expected = getattr(numpy, func)(a, out=out)
22312211
result = getattr(dpnp, func)(ia, out=usm_out)
22322212
assert result.get_array() is usm_out

Diff for: dpnp/tests/test_umath.py

-2
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,6 @@ def test_umaths(test_cases):
108108
and is_gpu_device()
109109
):
110110
pytest.skip("dpctl-1652")
111-
elif umath in ["ceil", "floor", "trunc"] and args[0].dtype == dpnp.bool:
112-
pytest.skip("dpctl-2030")
113111
elif (
114112
umath == "tan"
115113
and dpnp.issubdtype(args[0].dtype, dpnp.complexfloating)

0 commit comments

Comments
 (0)