Skip to contents

Fills the input Tensor with values drawn from the normal distribution

Usage

nn_init_normal_(tensor, mean = 0, std = 1)

Arguments

tensor

an n-dimensional Tensor

mean

the mean of the normal distribution

std

the standard deviation of the normal distribution

Examples

if (torch_is_installed()) {
w <- torch_empty(3, 5)
nn_init_normal_(w)
}
#> torch_tensor
#> -1.6273 -0.7202  2.6219 -0.9396  0.5344
#> -0.4191 -0.4570 -0.3374  0.4281  1.7199
#>  0.0850 -1.2873  0.4706  0.4160 -1.9950
#> [ CPUFloatType{3,5} ]