Skip to content

Commit 3ce1b68

Browse files
Tests added for problem from #728
```python In [1]: import dpctl.tensor as dpt In [2]: X = dpt.asarray([]) In [3]: dpt.astype(X, float) Out[3]: <dpctl.tensor._usmarray.usm_ndarray at 0x7fdb48137740> In [4]: (dpt.asnumpy(_), _.dtype, _.shape, _.strides) Out[4]: (array([], dtype=float64), dtype('float64'), (0,), (1,)) ```
1 parent 624564e commit 3ce1b68

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

dpctl/tests/test_usm_ndarray_ctor.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,8 @@ def test_setitem_same_dtype(dtype, src_usm_type, dst_usm_type):
600600
R2 = np.broadcast_to(Xnp[0], R1.shape)
601601
assert R1.shape == R2.shape
602602
assert np.allclose(R1, R2)
603+
Zusm_empty = Zusm_1d[0:0]
604+
Zusm_empty[Ellipsis] = Zusm_3d[0, 0, 0:0]
603605

604606

605607
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)