PyTorch UserWarning: volatile was removed and now has no effect. Use with torch.no_grad():
instead.
flyfish
torch.autograd.Variable(inputs, volatile=True)
Variables in the new version of PyTorch has been deprecated
#old codes
...
x = Variable(torch.randn(1), volatile=True)
return x
#new codes
with torch.no_grad():
...
x = torch.randn(1)
return x