Hi, I have a related question regarding this problem. Could you help me?
I have two models, and I hope I can use the sum output of the two models to update the two models.
The code is as follows:

spat_out = spat_model(spat_data)
temp_out = temp_model(temp_data)
spat_loss = spat_criterion(spat_out, labels)
temp_loss = temp_criterion(temp_out, labels)
loss = spat_loss + temp_loss
loss.backward()
spat_optimizer.step()
temp_optimizer.step()

loss.backward() will update wich models’ gradient? The last one or both of them?