asc.experimental.asctile.zeros
- asc.experimental.asctile.zeros(shape: Iterable[int], dtype: DataType = DataType('int32')) LocalTensor
Create a tensor filled with zeros.
The supported data types are:
int8,int16,int32,int64,float16,bfloat16,float32.- Parameters:
shape – The shape of the tensor to create.
dtype – The data type of the tensor. Default is
int32.
- Returns:
A new tensor filled with zeros
- Return type:
- Raises:
TypeError – If dtype is not a DataType
RuntimeError – If shape is invalid or dtype is not supported
Examples
Create a zero-filled tensor with default dtype (int32):
result = asctile.zeros([128])
Create a zero-filled tensor with a specific dtype:
result = asctile.zeros([32, 16], dtype=asctile.float16)