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.5856 -0.8901  1.1118 -1.4550  0.3338
#> -0.7863  1.1643  0.0192 -1.0633  0.3801
#>  1.0393 -1.0210  2.1862 -0.1842 -0.6338
#> [ CPUFloatType{3,5} ]