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 5fa93f4 commit 8374c9fCopy full SHA for 8374c9f
dpctl/tests/test_usm_ndarray_ctor.py
@@ -747,13 +747,13 @@ def test_to_device():
747
748
749
def test_astype():
750
- X = dpt.usm_ndarray((5, 5), "i4")
+ X = dpt.empty((5, 5), dtype="i4")
751
X[:] = np.full((5, 5), 7, dtype="i4")
752
Y = dpt.astype(X, "c16", order="C")
753
assert np.allclose(dpt.to_numpy(Y), np.full((5, 5), 7, dtype="c16"))
754
- Y = dpt.astype(X, "f2", order="K")
755
- assert np.allclose(dpt.to_numpy(Y), np.full((5, 5), 7, dtype="f2"))
756
- Y = dpt.astype(X, "i4", order="K", copy=False)
+ Y = dpt.astype(X[::2, ::-1], "f2", order="K")
+ assert np.allclose(dpt.to_numpy(Y), np.full(Y.shape, 7, dtype="f2"))
+ Y = dpt.astype(X[::2, ::-1], "i4", order="K", copy=False)
757
assert Y.usm_data is X.usm_data
758
759
0 commit comments