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
#>  2.0586 -0.6011  0.1289 -0.1643 -1.0831
#>  1.2762 -0.3647 -0.9368 -0.7432 -0.2907
#> -1.8759 -0.9698 -1.6828 -2.0560  0.7034
#> [ CPUFloatType{3,5} ]