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.1478  0.3302  1.4379  0.8988 -0.1674
#>  0.1804  1.2466 -1.3061 -0.3345  0.2397
#>  0.5363 -1.3692 -0.2766 -1.2271 -1.0775
#> [ CPUFloatType{3,5} ]