Solved by b02202050 in post #2 
              
              
                Basically, m3 will also have gradients after your loss.backward(). 
You can try the following code that I try to simulate your situation and you will got gradients on m3: 
m1 = torch.tensor(1.).requires_grad_()
m1 = torch.nn.Parameter(m1)
m2 = torch.tensor(2.).requires_grad_()
m2 = torch.nn.Paramete…