The file torch/csrc/autograd/variable.cpp refers to retain_variables when it should be retain_graph. No idea if it should *always* be retain_graph though ...