Which version are you using?
Two days ago PYTorch 0.4.0 was released merging Variables with Tensors.
I cannot find the line of code you’ve posted:
x = Variable(torch.ones(2, requires_grad=True))

And in 0.4.0 you don’t have to use Variables anymore.
You can find the install instructions on the website 32.
PS: I’ve edited the title to be a bit more clear.