dpnp.tensor.from_numpy¶
- dpnp.tensor.from_numpy(np_ary, /, *, device=None, usm_type='device', sycl_queue=None)[source]¶
Creates
dpnp.tensor.usm_ndarrayfrom instance ofnumpy.ndarray.- Parameters:
np_ary (array_like) -- Input convertible to
numpy.ndarraydevice ({None, object}, optional) --
array API specification of device where the output array is created. Device can be specified by a filter selector string, an instance of
dpctl.SyclDevice, an instance ofdpctl.SyclQueue, or an instance ofdpnp.tensor.Device. If the value isNone, returned array is created on the default-selected device.Default:
None.usm_type (str, optional) --
The requested USM allocation type for the output array. Recognized values are
"device","shared", or"host".Default:
"device".sycl_queue ({None, dpctl.SyclQueue}, optional) --
A SYCL queue that determines output array allocation device as well as execution placement of data movement operations. The
deviceandsycl_queuearguments are equivalent. Only one of them should be specified. If both are provided, they must be consistent and result in using the same execution queue.Default:
None.
- Returns:
out -- The returned array has the same shape, and the same data type kind. If the device does not support the data type of input array, a closest support data type of the same kind may be returned, e.g. input array of type
float16may be upcast tofloat32if the target device does not support 16-bit floating point type.- Return type: