I don’t know if this question is still relevant, but I included some recursive gradient examples in my post error-by-recursively-calling-jacobian-in-a-for-loop
I don’t know if this question is still relevant, but I included some recursive gradient examples in my post error-by-recursively-calling-jacobian-in-a-for-loop