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.5770 -0.1065  1.0072  0.5785 -0.4767
#> -0.2606  0.4676  0.8797  1.2718 -0.3883
#>  0.5485  0.2767  0.5848  1.7264  0.0642
#> [ CPUFloatType{3,5} ]