How to access ctx objects directly?

Hi there. I’d like to keep track of some statistical properties of activations in a network, in an output-dependent fashion. I do not see how I could use a forward hook, because the output of intermediate layers is not given as an argument to such hooks. Of course, I could also register output-saving forward hooks for each layer, but my understanding is that I would then be replicating context-saving functionality that is already implemented for backward passes. How can I access that functionality for my custom needs?