Skip to content

Commit ed4e003

Browse files
Adds tests based on examples in issue gh-1334
1 parent 848da90 commit ed4e003

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

dpctl/tests/test_usm_ndarray_ctor.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,25 @@ def test_usm_ndarray_flags():
109109
x.flags["C"] = False
110110

111111

112+
def test_usm_ndarray_flags_bug_gh_1334():
113+
get_queue_or_skip()
114+
a = dpt.ones((2, 3), dtype="u4")
115+
r = dpt.reshape(a, (1, 6, 1))
116+
assert r.flags["C"] and r.flags["F"]
117+
118+
a = dpt.ones((2, 3), dtype="u4", order="F")
119+
r = dpt.reshape(a, (1, 6, 1), order="F")
120+
assert r.flags["C"] and r.flags["F"]
121+
122+
a = dpt.ones((2, 3, 4), dtype="i8")
123+
r = dpt.sum(a, axis=(1, 2), keepdims=True)
124+
assert r.flags["C"] and r.flags["F"]
125+
126+
a = dpt.ones((2, 1), dtype="?")
127+
r = a[:, 1::-1]
128+
assert r.flags["F"] and r.flags["C"]
129+
130+
112131
@pytest.mark.parametrize(
113132
"dtype",
114133
[

0 commit comments

Comments
 (0)