Skip to content

Commit 8e952d1

Browse files
committed
add a test for gh-2121 resolution
1 parent 8ab92e1 commit 8e952d1

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

dpctl/tests/test_usm_ndarray_ctor.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1541,6 +1541,16 @@ def test_astype_gh_1926():
15411541
assert x is x__
15421542

15431543

1544+
def test_astype_gh_2121():
1545+
get_queue_or_skip()
1546+
1547+
x_np = np.asarray([0, 3, 1, 2, 0, 1], dtype="u1").view("?")
1548+
x = dpt.asarray(x_np)
1549+
res = dpt.astype(x, dpt.uint8)
1550+
expected = dpt.asarray([0, 1, 1, 1, 0, 1], dtype="u1")
1551+
assert dpt.all(res == expected)
1552+
1553+
15441554
def test_copy():
15451555
try:
15461556
X = dpt.usm_ndarray((5, 5), "i4")[2:4, 1:4]

0 commit comments

Comments
 (0)