Recording local derivative


The autograd module computes the gradient of the output respect to the each internal component such as activation maps and we can record the values using hook module. My question is that, given an input image, how I can access to the local derivative, for example the gradient of each activation maps in layer L (e.x. a_l) w.r.t each activation maps in layer L-1 (e.x. a_(l-1))? Is there a way to record these values in one backpropagation procedure or should I apply backward operation each time for each pair activation maps (a_l,a_(l-1))?

Thank you.