Skip to content

Commit 7e2a434

Browse files
committed
Adds a test for #1327
1 parent 7601dc5 commit 7e2a434

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

dpctl/tests/test_usm_ndarray_utility_functions.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,3 +148,20 @@ def test_arg_validation_boolean_reductions(func):
148148
func(d)
149149
with pytest.raises(AxisError):
150150
func(x, axis=-3)
151+
152+
153+
def test_boolean_reductions_3d_gh_1327():
154+
get_queue_or_skip()
155+
156+
size = 24
157+
x = dpt.reshape(dpt.arange(-10, size - 10, 1, dtype="i4"), (2, 3, 4))
158+
res = dpt.all(x, axis=0)
159+
res_np = np.full(res.shape, True, dtype="?")
160+
res_np[2, 2] = False
161+
162+
assert (dpt.asnumpy(res) == res_np).all()
163+
164+
x = dpt.ones((2, 3, 4, 5), dtype="i4")
165+
res = dpt.any(x, axis=0)
166+
167+
assert (dpt.asnumpy(res) == np.full(res.shape, True, dtype="?")).all()

0 commit comments

Comments
 (0)