ZimoNitrome:

Is there a reason why you need to backprop loss1 first and again when loss have been calculated?


Yes there’s a reason for that, the 1st backprop gives me access to inputs.grad which is used then to produce loss2.



 ZimoNitrome:

 # oss1.backward(retain_graph=True)    <-- Removed this line


Removing it will obliterate completely the purpose of loss2