Let’s say I have a model that I only want to run until the 8-th layer. I register a forward hook on that layer to save the output, and all works well. The problem is that the network will still run until completion, which makes things slower than necessary.
Is there a way to stopping it early? Or should I raise an exception in the forward hook and catch it outside, to get out of the network forward function?