diff --git a/dpctl/tensor/_ctors.py b/dpctl/tensor/_ctors.py index 5126f40837..d0cce717b0 100644 --- a/dpctl/tensor/_ctors.py +++ b/dpctl/tensor/_ctors.py @@ -67,6 +67,7 @@ def _array_info_sequence(li): ) if dim is None: dim = tuple() + dt = float device = _host_set return (n,) + dim, dt, device diff --git a/dpctl/tests/test_tensor_asarray.py b/dpctl/tests/test_tensor_asarray.py index 8c61fc9f13..d8c6f9d7ce 100644 --- a/dpctl/tests/test_tensor_asarray.py +++ b/dpctl/tests/test_tensor_asarray.py @@ -87,6 +87,11 @@ def test_asarray_from_sequence(): assert type(Y) is dpt.usm_ndarray assert Y.shape == (0,) + X = [[], []] + Y = dpt.asarray(X, usm_type="device") + assert type(Y) is dpt.usm_ndarray + assert Y.shape == (2, 0) + X = [True, False] Y = dpt.asarray(X, usm_type="device") assert type(Y) is dpt.usm_ndarray