Get data from intermediate layers in a Pytorch model
You can save the activations for intermediate layers into a variable within your forward method and then return them in addition to the output value.