What is volatile variable in Pytorch
What is volatile attribute of a Variable in Pytorch? Here's a sample code for defining a variable in PyTorch.

datatensor = Variable(data, volatile=True)


Basically, set the input to a network to volatile if you are doing inference only and won't be running backpropagation in order to conserve memory.

From the docs:


  Volatile is recommended for purely inference mode, when you’re sure
  you won’t be even calling .backward(). It’s more efficient than any
  other autograd setting - it will use the absolute minimal amount of
  memory to evaluate the model. volatile also determines that
  requires_grad is False.


Edit: The volatile keyword has been deprecated as of pytorch version 0.4.0
