but setting retain_graph=True would connect the loss1 and loss2, right? I should set that attribute to True only if I want to connect them which summing them up before calling backward makes much more sense in that case. Additionally, is retain_graph=True necessary for the loss2 as well?
thanks!