Warp your code into the torch.no_grad() guard, since Variables are deprecated:
# before
...
x = Variable(torch.randn(1), volatile=True)
return x

# now
with torch.no_grad():
    ...
    x = torch.randn(1)
return x