dpctl.tensor.full_like¶
- dpctl.tensor.full_like(x, fill_value, dtype=None, order='K', device=None, usm_type=None, sycl_queue=None)[source]¶
Returns a new
dpctl.tensor.usm_ndarrayfilled with fill_value and having the same shape as the input array x.- Parameters:
x (usm_ndarray) – Input array from which to derive the output array shape.
fill_value – the value to fill output array with
dtype (optional) – data type of the array. Can be typestring, a
numpy.dtypeobject,numpychar string, or a NumPy scalar type. IfdtypeisNone, the output array data type is inferred fromx. Default:Noneorder ("C", "F", "A", or "K") – memory layout for the array. Default:
"K"device (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 adpctl.tensor.Deviceobject returned bydpctl.tensor.usm_ndarray.device. Default:Noneusm_type (
"device","shared","host", optional) – The type of SYCL USM allocation for the output array. Default:"device"sycl_queue (
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:
New array initialized with given value.
- Return type: