Solved by albanD in post #12 
              
              
                I think the problem in your code is: 
for p in m.parameters():
  p = p - LR * p.grad

This does not modify p inplace ! It just assigns the result to a variable name p that you override just after. So you could remove these lines and your code would run the same. 
This is why you don’t see the link. 
…