Hello,
AFAIK, performing backward pass on the full loss is equal to backward separately.
The following two case are the same.
loss = loss1 + loss2
loss.backward()

loss1.backward(retain_graph=True)
loss2.backward()

If I am wrong, please correct me.