Fills the input Tensor with values drawn from the normal distribution

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 #> -0.6194 0.7818 -0.2960 1.7736 -0.1287 #> -0.9586 0.2466 0.1270 -0.3057 0.5785 #> 1.3467 1.3532 1.3662 0.7040 1.4877 #> [ CPUFloatType{3,5} ]