@apaszke  The example you showed  seems for a Variable not a Module. Is there any way I can do simillary on a Module?
What I actually want to do is modifying the input gradients that would be backward passed to the previous modules so that I can do adversarial training.
In Torch7, for example, GradientReversal module modifies the gradInput by mutlplying -1 (not gradients for the module’s weight updates).
Thanks!