The Variable API has been deprecated in Pytorch 1.10.
From Pytorch 1.10 documentation:
"Autograd automatically supports Tensors with requires_grad set to True
Variables are no longer necessary to use autograd with tensors."
The code can be further simplified if lines with Variable calls are removed. For example lines 56-57 of train.pyfile:
# convert to torch Variables
train_batch, labels_batch = Variable(train_batch), Variable(labels_batch)
The Variable API has been deprecated in Pytorch 1.10.
From Pytorch 1.10 documentation: "Autograd automatically supports Tensors with requires_grad set to True Variables are no longer necessary to use autograd with tensors."
The code can be further simplified if lines with Variable calls are removed. For example lines 56-57 of
train.py
file: