Adversarial network feature decorrelation: passing loss gradient

I eventually found a much more elegant solution here: [Solved] Reverse gradients in backward pass