Consider

torch.Tensor([torch.exp(torch.Tensor([10000]))])

it gives

tensor([inf.])

without raising any warning or error. During the training, many time I end up with nan value; and have to debug all the way to figure when did the numerical issue occurs.
Is there anyway to fix it
I’m using pytorch 0.4.0 on Mac
(Both jupyter notebook and pycharm doesn’t give any numerical warning)