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.0823  0.0616  0.5323 -1.1769  0.3879
#>  0.3714  0.4109 -0.4455 -0.7583 -0.0257
#>  1.0545  0.5064 -0.7582 -0.0225  0.5758
#> [ CPUFloatType{3,5} ]