Hi,
Wouldn’t it be most elegant to just have a GradientRevesrse Layer?
class GradReverse(Function):
    def forward(self, x):
        return x

    def backward(self, grad_output):
        return (-grad_output)

def grad_reverse(x):
    return GradReverse()(x)