Thanks for your reply!
The problem is I am obligated to use pytorch 0.3.0 and it seems this version doesn’t support requires_grad on Tensors.
So I think I should somehow wrap the data into Variable http://pytorch.org/docs/0.3.0/autograd.html 29
But how to do so I don’t know.