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.9060  0.9877 -0.5091  0.3334  0.7528
#>  0.4211  0.2504 -1.8502  1.1405 -0.0957
#>  0.7028 -2.0466  0.0873  0.6092 -0.4497
#> [ CPUFloatType{3,5} ]