The same code works with the same value of `epsilon` when it is changed to a Python built-in `float` instead. Tested with PyTorch 0.4.0 (CPU).