Method zeros
static member zeros: ITensorDevice -> int64 list -> Tensor<'T>
Creates a new tensor filled with zeros (0).
Declaration
static member zeros: dev:ITensorDevice -> shape:int64 list -> Tensor<'T>
Parameters
Type | Name | Description |
---|---|---|
ITensorDevice | dev | The device to create the tensor on. |
int64 list | shape | The shape of the new tensor. |
Returns
Type | Description |
---|---|
Tensor<'T> | The new tensor. |
Remarks
A new tensor of the specified shape is created on the specified device.
The tensor is filled with zeros.
Examples
let a = Tensor<float>.zeros HostTensor.Dev [2L; 3L]
// a = [[0.0; 0.0; 0.0]
// [0.0; 0.0; 0.0]]