@albanD thanks. Regardless of back prop through the output, this wouldn’t work at all for me without that parameter set — is this to be expected?
I got an error saying thing to be differentiated didn’t have required grad true. And when I checked the output of the first call to autograd.grad this was indeed the case.
For clarity: I took the gist and put in my own parameters and it didn’t work. I checked the intermediate value and it had requires grad false