A wrapper function that you can insert into any pytorch model to extract intermediate values from a neural network.

As a sample, the activations from a AlexNet model are saved.