Solved by ptrblck in post #2 
              
              
                You should be able to use the .weight parameters directly, instead of their .data attribute, which Autograd cannot track and which should thus be avoided.