outputs1 = model1(input1)
                    outputs2 = model2(input2)
                    outputs = outputs1 + outputs2 

                    loss = criterion(outputs, labels)
                    loss.bacward()

or
                   outputs1 = model1(input1)
                   outputs2 = model2(input2)
                   loss1 = criterion(outputs1, labels)
                   loss2 = criterion(outputs2, labels)
                   
                   loss = loss1 + loss2
                   loss.bacward()

Is there any difference between them?