returnn.torch.frontend._rand
¶
Random helpers
- returnn.torch.frontend._rand.no_grad_trunc_normal_(tensor: Tensor, mean, std, a, b, *, generator=None)[source]¶
Code copied and adopted from torch.nn.init._no_grad_trunc_normal_, to support the extra generator argument (https://github.com/pytorch/pytorch/issues/98200).
Method based on https://people.sc.fsu.edu/~jburkardt/presentations/truncated_normal.pdf
- Parameters:
tensor
mean
std
a
b
generator
- Returns:
tensor