In the following setup all models are nn.Modules, not necessarily stored in different interfaces. What would be a correct way of processing the following setup, in case all models/modules must be updated:
o1 = m1(i)
o2=m2(o1)
o3=m3(o1)
loss = loss1(o2, t1) + loss2(o3,t2)
loss.backward()

Specifically, do I need to detach and clone o1 before using it in o3, or maybe before o2?
EDIT: the reason for asking is when I checked the weights after training, I got an impressions some weights in m3 are not updated/frozen. I checked: all weights have requires_grad=True