Fills the input Tensor with values drawn from the normal distribution

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.4278 -1.8461 0.2692 -0.4537 0.0622 #> 0.2497 2.2805 -0.2020 0.1530 0.0831 #> 0.8084 -0.4409 0.5042 1.3481 -1.2371 #> [ CPUFloatType{3,5} ]