Hi,
Note that if you use the nightly build (or soon to be out 1.8 release), you can use the new version of the backward hook that now work properly and you don’t need to follow my previous comment above: Module — PyTorch master documentation 16