I would suggest a monte-carlo sampling imitating the one used by torch.normal, but instead of using the normal pdf (let’s cal it “f”), you use this pdf:
trunc_f = max( 0 , f - f(2*std) )

2017-07-11 14.14.48.jpg3771×2121 1.05 MB

In fact, you have to first truncate a centered normal with std=1, do the sampling, then you multiply the values by std and add the mean.