In the backward pass, to reduce the memory footprint all the intermediate results are cleared by default. To backprop again, you have to again build the graph, with retain_graph=True the intermediates are not deleted.