dpnp.tensor.zeros_like¶
- dpnp.tensor.zeros_like(x, /, *, dtype=None, order='K', device=None, usm_type=None, sycl_queue=None)[source]¶
Creates
dpnp.tensor.usm_ndarrayfrom USM allocation initialized with zeros.- Parameters:
x (usm_ndarray) -- Input array from which to derive the shape of the output array.
dtype ({None, dtype}, optional) --
data type of the array. Can be typestring, a
numpy.dtypeobject,numpychar string, or a NumPy scalar type. IfNone, output array has the same data type as the input array.Default:
None.order ({"C", "F", "A", "K"}, optional) --
memory layout for the array.
Default:
"K".device ({None, object}, optional) --
array API concept of device where the output array is created.
devicecan beNone, a oneAPI filter selector string, an instance ofdpctl.SyclDevicecorresponding to a non-partitioned SYCL device, an instance ofdpctl.SyclQueue, or adpnp.tensor.Deviceobject returned bydpnp.tensor.usm_ndarray.device.Default:
None.usm_type ({None, "device", "shared", "host"}, optional) --
The type of SYCL USM allocation for the output array.
Default:
None.sycl_queue ({None, dpctl.SyclQueue}, optional) --
The SYCL queue to use for output array allocation and copying.
sycl_queueanddeviceare complementary arguments, i.e. use one or another. If both are specified, aTypeErroris raised unless both imply the same underlying SYCL queue to be used. If both areNone, a cached queue targeting default-selected device is used for allocation and population.Default:
None.
- Returns:
out -- New array initialized with zeros.
- Return type: