Torch.autograd.grad function still freeing buffers although retain_graph=True

Hi,

Could you try to remove all inplace ops from your code?
It could be related to this issue.

1 Like