diff --git a/dpctl/tests/elementwise/test_add.py b/dpctl/tests/elementwise/test_add.py index ec89eeba84..44d91d34cc 100644 --- a/dpctl/tests/elementwise/test_add.py +++ b/dpctl/tests/elementwise/test_add.py @@ -306,7 +306,7 @@ def test_add_errors(): ar1 = dpt.ones(2, dtype="float32") ar2 = dpt.ones_like(ar1, dtype="int32") - y = np.empty_like(ar1) + y = np.empty(ar1.shape, dtype=ar1.dtype) with pytest.raises(TypeError) as excinfo: dpt.add(ar1, ar2, out=y) assert "output array must be of usm_ndarray type" in str(excinfo.value) diff --git a/dpctl/tests/test_tensor_clip.py b/dpctl/tests/test_tensor_clip.py index 106a4db695..2fdb91af62 100644 --- a/dpctl/tests/test_tensor_clip.py +++ b/dpctl/tests/test_tensor_clip.py @@ -544,7 +544,7 @@ def test_clip_errors(): ar1 = dpt.ones(2, dtype="i4") ar2 = dpt.ones_like(ar1, dtype="i4") ar3 = dpt.ones_like(ar1, dtype="i4") - ar4 = np.empty_like(ar1) + ar4 = np.empty(ar1.shape, dtype=ar1.dtype) assert_raises_regex( TypeError, "output array must be of usm_ndarray type",