[Solved] Reverse gradients in backward pass

If you convert scale to scale = torch.tensor(1.0, requires_grad=False) it should work

I have the similar question like your second question. Is there bad effect if feature extractor update twice on the same data? Do you have the answer now?
Thank you!

I have an additional question, suppose I have two classes and need only one to be treated as domain invariant, how do I ensure that features only belonging to that class are sent through the gradient reverse layer to the domain discriminator?