Hey,
I don’t know what the model is, but is first_layer actually uses? And does the inputs for it actually require gradients (things that don’t require gradients won’t have their gradients computed and so no hook will be called)?
Also, as per the doc, the nn.Module backward hooks are in a fairly bad state right now and might return wrong results!