I’m not sure if this is relevant or not, but I also checked the .grad and noticed that:
>>> type(output1.grad)
<class 'NoneType'>
>>> type(neg_output1.grad)
<class 'NoneType'>

Perhaps this is related to the problem?