SimonW:

loss.backward()
print(loss.grad)
This makes no sense. loss.backward implicitly backwards a grad_output of 1.


Yes, you are right. I just needed an extra line to stop the debugger.



 SimonW:

Sorry I didn’t read the entire thread when I first replied. This is a bug at https://github.com/pytorch/pytorch/issues/4320.


Thanks so much. I hoped that they fixed it in the 0.4.0a0+94f439c release, but apparently not yet