can I ask for one more follow up questions?
In the code, when I first time do the backward()
loss.backward(der_shape)
I didn’t use retain_graph=True.
Second time, when I backward()
var_loss.backward()

It supposedly trying to backward through the graph a second time, because differentiate gr_a and gr_b involves parameters of neural network. Why didn’t it raise RuntimeError: Trying to backward through the graph a second time, but the buffers have already been freed. error?