codeknight11:

What’s the point of using “Variable” and then setting requires_grad=False ?


Before Variable and Tensor were merged, you could only do computation between tensors or between variables, but not mix them.



 codeknight11:

target_var = torch.Tensor(target_vec, requires_grad=False) 



We don’t use Tensor constructors anymore  but only torch.tensor factory methods 1.
Best regards
Thomas