Thank you for your comment.
umm… that case, loss maybe 0. and Backpropagation doesn’t seem to happen.
The problem is that if you simply add, the main loss disappears. (One is -loss, the other is loss)
If you look at the original, it can easily find different gradients. like
a_gradient = tape.gradient(a_loss, a.parameters())
b_gradient = tape.gradient(b_loss, b.parameters())

a_optimizer.apply_gradients(zip(a_gradient, a.parameters()))
b_optimizer.apply_gradients(zip(b_gradient, b.parameters()))

As a result of my testing, it seems that partial differentiation with simple backward() is not possible.
Isn’t there a good similar method?