I have defined two seprate network now.
def common():
Optim1= optim.adam(network1.params)
Optim2= optim.adam(network2.params)
Optim1.zero_grad()
Optim2.zero_grad()
Loss1.backward()
Loss2.backward()
Optim1.step()
Optim2.step()
Here to get run above function I need to do retain graph variable true…
So here when I do Loss1.backward() at that time Loss1 is getting back propagated in both neural network or  only in first neural network?