# tensorplay.nn.init.trunc_normal_

Source: https://www.tensorplay.cn/docs/generated/tensorplay.nn.init.trunc_normal_.html

# tensorplay.nn.init.trunc_normal_

tensorplay.nn.init.trunc_normal_(tensor, mean=0.0, std=1.0, a=-2.0, b=2.0)[[source]](../_modules/tensorplay/nn/init.html#trunc_normal_)

Fills the input Tensor with values drawn from a truncated normal
distribution.

Method is based on the rejection-sampling scheme in
[https://people.sc.fsu.edu/~jburkardt/presentations/truncated_normal.pdf](https://people.sc.fsu.edu/~jburkardt/presentations/truncated_normal.pdf) —
a direct port of torch.nn.init._no_grad_trunc_normal_ (torch/nn/init.py),
which torchvision transformer models use for positional embeddings.
