Gradient formulas are based on Simple Statistical Gradient-Following
Algorithms for Connectionist Reinforcement Learning, available at
http://incompleteideas.net/sutton/williams-92.pdf 10
https://github.com/pytorch/pytorch/blob/master/torch/autograd/_functions/stochastic.py#L3-L5 16