def trunc_normal_(x:Tensor, mean:float=0., std:float=1.) -> Tensor:
    "Truncated normal initialization."
    # From https://discuss.pytorch.org/t/implementing-truncated-normal-initializer/4778/12
    return x.normal_().fmod_(2).mul_(std).add_(mean)
def trunc_normal_ ( x : Tensor , mean : float = 0. , std : float = 1. ) -> Tensor : return x . normal_ ( ) . fmod_ ( 2 ) . mul_ ( std ) . add_ ( mean )
Truncated normal initialization.