Skip to content

Commit 0257019

Browse files
committed
Fixed print test failing due to fp16
1 parent b173cb6 commit 0257019

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

dpctl/tests/test_usm_ndarray_print.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,8 @@ def test_print_repr(self):
208208
"\n [6, 7, 8]])",
209209
)
210210

211-
x = dpt.arange(4, dtype="f2", sycl_queue=q)
212-
assert repr(x) == "usm_ndarray([0., 1., 2., 3.], dtype=float16)"
211+
x = dpt.arange(4, dtype="i4", sycl_queue=q)
212+
assert repr(x) == "usm_ndarray([0, 1, 2, 3], dtype=int32)"
213213

214214
def test_print_repr_abbreviated(self):
215215
q = get_queue_or_skip()
@@ -218,8 +218,8 @@ def test_print_repr_abbreviated(self):
218218
x = dpt.arange(9, sycl_queue=q)
219219
assert repr(x) == "usm_ndarray([0, ..., 8])"
220220

221-
y = dpt.asarray(x, dtype="f2", copy=True)
222-
assert repr(y) == "usm_ndarray([0., ..., 8.], dtype=float16)"
221+
y = dpt.asarray(x, dtype="i4", copy=True)
222+
assert repr(y) == "usm_ndarray([0, ..., 8], dtype=int32)"
223223

224224
x = dpt.reshape(x, (3, 3))
225225
np.testing.assert_equal(
@@ -232,9 +232,9 @@ def test_print_repr_abbreviated(self):
232232
y = dpt.reshape(y, (3, 3))
233233
np.testing.assert_equal(
234234
repr(y),
235-
"usm_ndarray([[0., ..., 2.],"
235+
"usm_ndarray([[0, ..., 2],"
236236
"\n ...,"
237-
"\n [6., ..., 8.]], dtype=float16)",
237+
"\n [6, ..., 8]], dtype=int32)",
238238
)
239239

240240
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)