Hi! I was trying to do backward on the first derivative (Jacobian). I observed that the usage of memory continues to grow if y.backward(retain_graph=True,create__graph=True) .
I have read this post https://discuss.pytorch.org/t/how-to-free-the-graph-after-create-graph-true/58476/4 14, where it is said the graph will be deteted if the referece is deleted.
But I also found this post: https://github.com/pytorch/pytorch/issues/4661 21, stating that the leakage issue is still open.
I am confused. Could you please help me out? And I can’t use  torch.autograd.grad, since my outputs y are vectors, not scalar outputs.
Thanks!