I have a question.
input1 = #sth
input2 = # sth
label1 = # sth
label2 = # sth
output1 = model(input1)
output2 = model(input2)
loss1 = criterion(output1, label1)
loss2 = criterion(output2, label2)
total = loss1+loss2
total_loss.backward()

Does total loss consider the effect of loss1? I mean will
output2 = model(input2)

overwrite the gradient or any  information about input1 ?