From 1feee2fc78fd4774adb00079f8348bf4355bf787 Mon Sep 17 00:00:00 2001 From: Oleksandr Pavlyk <21087696+oleksandr-pavlyk@users.noreply.github.com> Date: Wed, 15 Jan 2025 11:37:07 -0600 Subject: [PATCH] Replace np.empty_like(usm_ndarray_inst) with np.empty(shape, dtype=dt) --- dpctl/tests/elementwise/test_add.py | 2 +- dpctl/tests/test_tensor_clip.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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",