I think you should check pytorch version. using
import torch
print(torch.__version__)

latest version as of 2020 is 1.6.0
That Variable is deprecated in new pytorch version. Instead you could use
autograd_tensor = torch.randn((2, 3, 4), requires_grad=True) , See here https://pytorch.org/docs/stable/autograd.html#variable-deprecated,
I think You should go through https://pytorch.org/tutorials/ 1, examples like https://pytorch.org/tutorials/beginner/blitz/cifar10_tutorial.html 1  to see it working.