Solved by albanD in post #12 
              
              
                Hi, 
It is expected that requires_grad=False inside the custom Function. These are built explicitly so that you specify what the backward should be. So there is no reason to track the gradients during the forward. 
You’re missing a return statement there btw. 
Why are you using a custom Function her…