Hi mailcorahul,
Thanks for your advice!
I want to implement an algorithm which calculates effective path of neural network, which is proposed by a recent paper. In fact I don’t really need to do it in backpropagation process, but as the algorithm processes the network from output layer to input layer, I think implementing it in backpropagation process might be natural.
However, I still have some questions on that solution. First, where should I put the intermediate layers’ results, since the hook doesn’t need ctx as a parameter? Besides, sometimes a module will be used several times in a model, will that cause some problems?