Skip to content

Commit 6c9a8cd

Browse files
committed
Fixed test_full_order
1 parent 1d82b34 commit 6c9a8cd

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

dpctl/tensor/_ctors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -770,7 +770,7 @@ def full(
770770
usm_type=usm_type,
771771
sycl_queue=sycl_queue,
772772
)
773-
return dpt.copy(dpt.broadcast_to(X, sh))
773+
return dpt.copy(dpt.broadcast_to(X, sh), order=order)
774774

775775
sycl_queue = normalize_queue_device(sycl_queue=sycl_queue, device=device)
776776
usm_type = usm_type if usm_type is not None else "device"

dpctl/tests/test_usm_ndarray_ctor.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1031,24 +1031,24 @@ def test_full_compute_follows_data():
10311031
@pytest.mark.parametrize("order2", ["F", "C"])
10321032
def test_full_order(order1, order2):
10331033
q = get_queue_or_skip()
1034-
Xnp = np.array([1,2,3], order=order1)
1035-
Ynp = np.full((3), Xnp, order=order2)
1036-
Y = dpt.full((3), Xnp, order=order2, sycl_queue=q)
1037-
assert Y.flags.f_contiguous == Ynp.flags.f_contiguous
1034+
Xnp = np.array([1, 2, 3], order=order1)
1035+
Ynp = np.full((3, 3), Xnp, order=order2)
1036+
Y = dpt.full((3, 3), Xnp, order=order2, sycl_queue=q)
10381037
assert Y.flags.c_contiguous == Ynp.flags.c_contiguous
1038+
assert Y.flags.f_contiguous == Ynp.flags.f_contiguous
10391039
assert np.array_equal(dpt.asnumpy(Y), Ynp)
10401040

10411041

10421042
def test_full_strides():
10431043
q = get_queue_or_skip()
1044-
X = dpt.full((3,3), dpt.arange(3, dtype='i4'), sycl_queue=q)
1045-
Xnp = np.full((3,3), np.arange(3, dtype='i4'))
1046-
assert X.strides == tuple( el // Xnp.itemsize for el in Xnp.strides)
1044+
X = dpt.full((3, 3), dpt.arange(3, dtype="i4"), sycl_queue=q)
1045+
Xnp = np.full((3, 3), np.arange(3, dtype="i4"))
1046+
assert X.strides == tuple(el // Xnp.itemsize for el in Xnp.strides)
10471047
assert np.array_equal(dpt.asnumpy(X), Xnp)
10481048

1049-
X = dpt.full((3,3), dpt.arange(6, dtype='i4')[::2], sycl_queue=q)
1050-
Xnp = np.full((3,3), np.arange(6, dtype='i4')[::2])
1051-
assert X.strides == tuple( el // Xnp.itemsize for el in Xnp.strides)
1049+
X = dpt.full((3, 3), dpt.arange(6, dtype="i4")[::2], sycl_queue=q)
1050+
Xnp = np.full((3, 3), np.arange(6, dtype="i4")[::2])
1051+
assert X.strides == tuple(el // Xnp.itemsize for el in Xnp.strides)
10521052
assert np.array_equal(dpt.asnumpy(X), Xnp)
10531053

10541054

0 commit comments

Comments
 (0)