Solved by ptrblck in post #2 
              
              
                I’m not sure where this warning is raised, since I cannot see any usage of the .grad attribute. 
However, your current code should fail with: 
RuntimeError: a view of a leaf Variable that requires grad is being used in an in-place operation.

and you would need to manipulate the parameter in a torch…