Solved by ptrblck in post #2 
              
              
                Since PyTorch 0.4.0 you don’t have to use Variables anymore. 
You can use tensors now and set requires_grad=True, if you need the gradient for this tensor. 
If you don’t need gradients at all, e.g. for validation, wrap your code in with torch.no_grad():. This was previously achieved by setting volat…