Hi,
According to http://pytorch.org/docs/autograd.html#torch.autograd.Variable.backward 404  this flag is used to prevent any buffer from being freed during the backprop (this is usually done to reduce the memory requirements).
In practice, that means that calling y.backward twice is only possible if the first one was done with retain_variables=True.
You can see this behaviour in the sample below when switching retain_variable between True and False:
import torch
from torch.autograd import Variable
x = Variable(torch.ones(2, 2), requires_grad = True)
y = x ** 2
y.backward(torch.ones(2, 2), retain_variables=False)
print "first backward of x is:"
print x.grad
y.backward(2*torch.ones(2, 2), retain_variables=False)
print "second backward of x is:"
print x.grad