Solved by ptrblck in post #2 
              
              
                Have a look at this tutorial. 
Basically the hooks can be used used to manipulate or get the intermediate activations and gradients. 
You can find a simple example of using forward hooks here.