How to modify the gradients in the backward pass? Using a register_hook for saving the gradients of a Variable: link When we want to get more crazy with the gradients and want only one gradient computation to be done from two heads
zz1
/
yy
\
zz2
Want gradient to flow backward from only zz1 part: link