Self-published2021Extracting Intermediate Layer Outputs in PyTorch
Sometimes the useful signal sits in a hidden layer rather than the output. We compare three ways to read those activations in PyTorch, from forward hooks to slicing the module list, and use them to pull out embeddings.



