Khabbab_Zakaria:

We use Variable(…, requires_grad = True) on the calculated losses.


This sounds wrong as you are rewrapping the loss tensors and are thus detaching them from the computation graph besides Variables being deprecated since PyTorch 0.4, so remove this line of code and rerun your training.