Ok, I see. thanks!
Off-topic for this thread really (which is about how to solve a problem, rather than about design), but seems like it might be nice to have an api that would work like:
somevar.save_grad(True)
... do backprop here...
... somevar.grad now has some values :-)

save_grad(True) could work behind the scenes by secretely, or not so secretly, calling var.register_hook, to add in an appropriate hook somewere to save the grad, perhaps?