Skip to content

dpnp.array doesn't return dpnp.ndarray #1570

Closed
@samir-nasibli

Description

@samir-nasibli

Description

dpnp.array returns the same object, it is expected that it will return wrapped dpnp.ndarray with the same sycl_usm_arrray_interface.

>>> import dpctl
>>> import dpctl.tensor as dpt
>>> import dpnp
>>> dpctl_arr = dpctl.tensor.zeros(12, usm_type="device", sycl_queue=dpctl.SyclQueue("gpu"))
>>> dpctl_arr
usm_ndarray([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.])
>>> result = dpnp.array(dpctl_arr, copy=False)
>>> result
usm_ndarray([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.])
>>> type(result)
<class 'dpctl.tensor._usmarray.usm_ndarray'>

Env

Python 3.10.13

conda list | grep dp
dpctl                     0.15.0rc2
dpnp                      0.13.0rc2
mkl-dpcpp                 2024.0.0

Metadata

Metadata

Assignees

No one assigned

    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