Skip to content

Commit

Permalink
Adds tests based on examples in issue gh-1334
Browse files Browse the repository at this point in the history
  • Loading branch information
oleksandr-pavlyk committed Aug 11, 2023
1 parent f5b96b7 commit 706d80f
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions dpctl/tests/test_usm_ndarray_ctor.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,25 @@ def test_usm_ndarray_flags():
x.flags["C"] = False


def test_usm_ndarray_flags_bug_gh_1334():
get_queue_or_skip()
a = dpt.ones((2, 3), dtype="u4")
r = dpt.reshape(a, (1, 6, 1))
assert r.flags["C"] and r.flags["F"]

a = dpt.ones((2, 3), dtype="u4", order="F")
r = dpt.reshape(a, (1, 6, 1), order="F")
assert r.flags["C"] and r.flags["F"]

a = dpt.ones((2, 3, 4), dtype="i8")
r = dpt.sum(a, axis=(1, 2), keepdims=True)
assert r.flags["C"] and r.flags["F"]

a = dpt.ones((2, 1), dtype="?")
r = a[:, 1::-1]
assert r.flags["F"] and r.flags["C"]


@pytest.mark.parametrize(
"dtype",
[
Expand Down

0 comments on commit 706d80f

Please sign in to comment.