We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4694a25 commit e933da5Copy full SHA for e933da5
dpctl/tests/test_usm_ndarray_utility_functions.py
@@ -84,16 +84,24 @@ def test_boolean_reduction_axis(func, identity):
84
85
86
@pytest.mark.parametrize("func", [dpt.all, dpt.any])
87
-def test_all_any_keepdims(func):
+def test_boolean_reduction_keepdims(func):
88
get_queue_or_skip()
89
90
x = dpt.ones((2, 3, 4, 5, 6), dtype="i4")
91
-
92
res = func(x, axis=(1, 2, -1), keepdims=True)
93
assert res.shape == (2, 1, 1, 5, 1)
94
assert_array_equal(dpt.asnumpy(res), np.full(res.shape, True))
95
96
+@pytest.mark.parametrize("func,identity", [(dpt.all, True), (dpt.any, False)])
97
+def test_boolean_reduction_empty(func, identity):
98
+ get_queue_or_skip()
99
+
100
+ x = dpt.empty((0,), dtype="i4")
101
+ res = func(x)
102
+ assert_equal(dpt.asnumpy(res), identity)
103
104
105
# nan, inf, and -inf should evaluate to true
106
107
def test_boolean_reductions_nan_inf(func):
0 commit comments