Thanks for your answer.
Yeah, I tried to design it but had to call ‘backward’ from inside another ‘backward’ function which didn’t work. It seem that it was just fixed recently, at least in the source code, so I’ll try to get back to it soon.
Still not sure though how to disable the activations  from being saved to memory during the forward pass but I’ll look that up.