Skip to content

Commit 770042e

Browse files
authored
update a test for dpnp.pad with mode empty to avoid direct comparison (#2144)
1 parent b9dfc72 commit 770042e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/test_arraypad.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,10 @@ def test_pad_empty_dim_valid(self, mode):
432432
a_dp = dpnp.array(a_np)
433433
expected = numpy.pad(a_np, [(0,), (2,), (1,)], mode)
434434
result = dpnp.pad(a_dp, [(0,), (2,), (1,)], mode)
435-
assert_dtype_allclose(result, expected)
435+
assert result.shape == expected.shape
436+
if mode == "constant":
437+
# In "empty" mode, arrays are uninitialized and comparing may fail
438+
assert_dtype_allclose(result, expected)
436439

437440
@pytest.mark.parametrize(
438441
"mode",

0 commit comments

Comments
 (0)