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
#>  0.2318  0.7985  0.3031 -0.0332 -1.2838
#> -1.3541  1.3673  0.1314 -0.8317  1.4889
#> -1.3852 -0.6360 -1.8055 -2.1605 -0.7451
#> [ CPUFloatType{3,5} ]