Returns a tensor filled with random numbers from a normal distribution with mean 0 and variance 1 (also called the standard normal distribution).
tch_randn(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' |
The shape of the tensor is defined by the variable argument sizes.
#> tensor #> -1.3646 0.7239 #> -0.1713 0.5700 #> [ Variable[CPUFloatType]{2,2} ]#> tensor #> -0.4831 1.3880 #> 1.1428 0.0722 #> [ Variable[CPUDoubleType]{2,2} ]