After messing with this for a while, I wanted to add one caveat that I encountered.  Some layers objects, like ReLU, are re-used throughout the network.  I guess it’s any layer without parameters, but I’m not sure.  The result is that if you put a hook on a ReLU layer, like encoder.encoder[1].mout[0].register_forward_hook(get_activation('B1.mout.relu')) in QuartzNet, it gets called for every ReLU in the whole model, not just the one you wanted.  So the final result in the dictionary is actually the ReLU output for the final model output, not the ReLU output associated with the layer where you registered the hook.