Skip to content

0d usm_ndarray must allow conversion to Python scalars #545

Closed
@oleksandr-pavlyk

Description

@oleksandr-pavlyk
In [2]: import dpctl

In [3]: import dpctl.tensor as dpt

In [4]: dpt.usm_ndarray(tuple(), dtype='d')
Out[4]: <dpctl.tensor._usmarray.usm_ndarray at 0x7f562c2859f0>

In [5]: float(_)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-5-a06b00cb7231> in <module>
----> 1 float(_)

TypeError: float() argument must be a string or a number, not 'dpctl.tensor._usmarray.usm_ndarray'

In[5] should work.

Same for Python integers, and Python bools.

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