Forward hooks would be a good way to inspect the output of a specific layer as given in e.g. this post.
Based on your code snippet it seem you want to recreate the model somehow, which might be tricky since you are re-wrapping everything into an nn.Sequential
block, which might miss important functional API calls from the original forward
method.