Solved by pinocchio in post #2 
              
              
                check if it has flag requires_grad to true: 
Python 3.6.5 |Anaconda, Inc.| (default, Apr 29 2018, 16:14:56)
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> x = torch.randn(3,4)
>>> x
tensor([[ 0.5905,  0.7622,  0.5487,  0.4738],
      …