Hello!
I wrote a little code that might work. Try it out and report back .
model1 = Net(...)
model2 = Net(...)

all_params = list(model1.parameters()) + list(model2.parameters())
optimizer = torch.optim.Adam(all_params)

loss = torch.nn.CrossEntropyLoss() # or other loss
loss_for_specific_nodes = None # whatever loss you want

outp1 = model1(inputs)
outp2 = model2(inputs)

loss1 = loss(outp1, labels)
loss2 = loss(outp2, labels)

special_node_output = ...
special_node_labels = ...
special_loss = loss_for_specific_nodes(special_node_output, special_node_labels)

final_loss = loss1 + loss2 + special_loss
final_loss.backward()
optimizer.step()