Thank you for this information. Still a little bit confused on how to use it. Apparently you need to create your own “hooking function”, then pass the function into the register_forward_hook method to grab the output? E.g. Layer1.register_forward_hook( “hooking function”).
Edited: This is useful too.
https://pytorch.org/tutorials/beginner/former_torchies/nn_tutorial.html#forward-and-backward-function-hooks 10
Edited 2: Just did a quick look through their example they didn’t use ANY hooks? Did they remove the tutorial? This is the linked example, unless I am bind I don’t see anything about getting the output from conv2.
Final edited: Idk why my google search led me to the old tutorial here is the updated one…
https://pytorch.org/tutorials/beginner/former_torchies/nnft_tutorial.html?highlight=hook 9