@SimonW I am implementing  ManifoldMixup (http://proceedings.mlr.press/v97/verma19a/verma19a.pdf 3) which is similar to Mixup regularization technique except it works at layer level instead of input level as in Mixup. I need a similar functionality to implement this,

Select a random index and apply forward hook to that layer
Forward pass using data input x_0 and record output at hooked layer
Use this output along with new input x_1 by adding new hook at the same layer to do this mixup operation

It would be nice if I can stop processing model’s forward pass at hook in first step. Is there a better way to do this now since it has been over a year after this thread?