Which PyTorch version are you using? Variables are deprecated since 0.4.0, so this error message shouldn’t be raised anymore.
Variables
0.4.0