Skip to content

dpctl.tensor.asarray raises TypeError with [[], []] as input #696

Closed

Description

@densmirn

Reproducer:

In [1]: import dpctl.tensor as dpt

In [2]: dpt.asarray([[],[]])
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-7-daad18362542> in <module>
----> 1 dpt.asarray([[],[]])

/localdisk/work/denissmi/dpctl/dpctl/tensor/_ctors.py in asarray(obj, dtype, device, copy, usm_type, sycl_queue, order)
    385                 "Converting Python sequence to usm_ndarray requires a copy"
    386             )
--> 387         _, dt, devs = _array_info_sequence(obj)
    388         if devs == _host_set:
    389             return _asarray_from_numpy_ndarray(

/localdisk/work/denissmi/dpctl/dpctl/tensor/_ctors.py in _array_info_sequence(li)
     57         if dim is None:
     58             dim = el_dim
---> 59             dt = np.promote_types(el_dt, el_dt)
     60             device = device.union(el_dev)
     61         elif el_dim == dim:

TypeError: did not understand one of the types

dpctl version:

In [3]: import dpctl

In [4]: dpctl.__version__
Out[9]: '0.11.0+31.gd9cfb43a'

Activity

  1. added 2 commits that reference this issue on Nov 30, 2021
    a3eb12d
    acadbd1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions