I need some advice.
So I am currently using retain graph = True in my code, simply because I need all the gradients of previous tensors in my code.
The reason for this is, that my variables come from a recursion, where one variable depends on another which in turn depends on another, all the way till the first variable.
(I hope I was able to explain this).
I want to get rid of the retain graph = True as it takes a lot of time in computation.
Is there a way I could combine all gradients and pass it on to the next iteration or something like this which will enable me to get rid of retain Graph = True
Thanks