Skip to content

dpnp.ones_like() is failing with dpex.asarray() #1272

Closed
@mingjie-intel

Description

@mingjie-intel

Some DPEX cases are failing with dpnp 0.11.0 when calling dpnp.ones_like(). I did a quick test:

This is OK:

a=dpnp.arange(10)
b=dpnp.ones_like(a)

This is not OK:

a = dpex.asarray(dpnp.arange(10))
b = dpnp.ones_like(a)

With the error message:

Traceback (most recent call last):
File "", line 1, in
File "/localdisk/work/mingjie2/miniconda3/envs/numba_dpex_env/lib/python3.9/site-packages/dpnp/dpnp_iface_arraycreation.py", line 1221, in ones_like
return call_origin(numpy.ones_like, x1, dtype, order, subok, shape)
File "dpnp/dpnp_utils/dpnp_algo_utils.pyx", line 132, in dpnp.dpnp_utils.dpnp_algo_utils.call_origin
NotImplementedError: Requested funtion=ones_like with args=(usm_ndarray([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]), None, 'C', False, None) and kwargs={} isn't currently supported and would fall back on NumPy implementation. Define enviroment variable DPNP_RAISE_EXCEPION_ON_NUMPY_FALLBACK to 0 if the fall back is required to be supported without rasing an exception.

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