Skip to content
15 changes: 5 additions & 10 deletions dpnp/dpnp_iface_manipulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,18 +89,13 @@ def asfarray(a, dtype=None):

Comment thread
npolina4 marked this conversation as resolved.
"""
Comment thread
npolina4 marked this conversation as resolved.
Comment thread
npolina4 marked this conversation as resolved.

a_desc = dpnp.get_dpnp_descriptor(a, copy_when_nondefault_queue=False)
if a_desc:
if dtype is None or not numpy.issubdtype(dtype, dpnp.inexact):
if dtype is None or not numpy.issubdtype(dtype, dpnp.inexact):
if dpnp.is_supported_array_type(a):
dtype = dpnp.default_float_type(sycl_queue=a.sycl_queue)
else:
dtype = dpnp.default_float_type()

# if type is the same then same object should be returned
if a_desc.dtype == dtype:
return a

return array(a, dtype=dtype)

return call_origin(numpy.asfarray, a, dtype)
return array(a, dtype=dtype)
Comment thread
npolina4 marked this conversation as resolved.
Outdated


def atleast_1d(*arys):
Expand Down