Returns a tensor filled with the scalar value 0, with the shape defined by the variable argument sizes.
tch_zeros(sizes, dtype = NULL, layout = NULL, device = NULL, requires_grad = FALSE)
sizes | a sequence of integers defining the shape of the output tensor. |
---|---|
dtype | the desired data type of returned tensor. Default: if |
device | the desired device of returned tensor. Default: if |
requires_grad | If autograd should record operations on the
returned tensor. Default: |
the | desired layout of returned Tensor. Default: 'strided' |
#> tensor #> 0 0 0 0 #> 0 0 0 0 #> [ Variable[CPUFloatType]{2,4} ]tch_zeros(5)#> tensor #> 0 #> 0 #> 0 #> 0 #> 0 #> [ Variable[CPUFloatType]{5} ]