Skip to content

Commit c1c6b0d

Browse files
Add test based on gh-1391
1 parent 4c3c23f commit c1c6b0d

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

dpctl/tests/test_tensor_sum.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,3 +172,18 @@ def test_largish_reduction(arg_dtype, n):
172172

173173
assert dpt.all(dpt.equal(y1, y2))
174174
assert dpt.all(dpt.equal(y1, n * m))
175+
176+
177+
def test_axis0_bug():
178+
"gh-1391"
179+
get_queue_or_skip()
180+
181+
sh = (1, 2, 3)
182+
a = dpt.arange(sh[0] * sh[1] * sh[2], dtype="i4")
183+
a = dpt.reshape(a, sh)
184+
aT = dpt.permute_dims(a, (2, 1, 0))
185+
186+
s = dpt.sum(aT, axis=2)
187+
expected = dpt.asarray([[0, 3], [1, 4], [2, 5]])
188+
189+
assert dpt.all(s == expected)

0 commit comments

Comments
 (0)