How to access gradients w.r.t. activations before and after a layer/module

Hi all,

I know that after a backward pass we can access the gradients w.r.t the parameters (i.e., weights, bias, etc.) of a layer, but is there a way to retrieve the gradients w.r.t the activation coming in and out of the current layer?

Namely, dA_i-1 and dA_i in this graph.