trunc_normal_¶
dragon.vm.torch.nn.init.
trunc_normal_
(
tensor,
mean=0,
std=1,
a=- 2,
b=2
)[source]¶Fill tensor from a truncated normal distribution.
\[\text{tensor} \sim \mathcal{TN}(\mu, \sigma^{2}, a, b) \]- Parameters:
- tensor (dragon.vm.torch.Tensor) – The input tensor.
- mean (number, optional, default=0) – The value to \(\mu\).
- std (number, optional, default=1) – The value to \(\sigma\).
- a (number, optional, default=-2) – The value to \(a\).
- b (number, optional, default=2) – The value to \(b\).
- Returns:
dragon.vm.torch.Tensor – The output tensor.