dpctl.tensor.zeros¶
- dpctl.tensor.zeros(shape, *, dtype=None, order='C', device=None, usm_type='device', sycl_queue=None)[source]¶
- Returns a new - dpctl.tensor.usm_ndarrayhaving a specified shape and filled with zeros.- Parameters:
- shape (Tuple[int], int) – Dimensions of the array to be created. 
- dtype (optional) – data type of the array. Can be typestring, a - numpy.dtypeobject,- numpychar string, or a NumPy scalar type. Default:- None
- order ("C", or "F") – memory layout for the array. Default: - "C"
- device (optional) – array API concept of device where the output array is created. - devicecan be- None, a oneAPI filter selector string, an instance of- dpctl.SyclDevicecorresponding to a non-partitioned SYCL device, an instance of- dpctl.SyclQueue, or a- dpctl.tensor.Deviceobject returned by- dpctl.tensor.usm_ndarray.device. Default:- None
- usm_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_queueand- deviceare complementary arguments, i.e. use one or another. If both are specified, a- TypeErroris raised unless both imply the same underlying SYCL queue to be used. If both are- None, a cached queue targeting default-selected device is used for allocation and population. Default:- None
 
- Returns:
- Constructed array initialized with zeros. 
- Return type: