Hi @harshj94,
In PyTorch, gradients are accumulating by default.
So if you simply have this before optimizer.step:
Loss1.backward()
Loss2.backward()

with no optimizer.zero_grad()  in between,
you will end up with x.grad containing dLoss1/dx + dLoss2/dx.
Also when you create the optimzer you have to give it the params of the 3 models:
optimizer = torch.optim.Adam(list(model1.parameters()) + list(model2.parameters()) + list(model3.parameters()))