| 9 | |
| 10 | |
| 11 | class ReverseLayerF(Function): |
| 12 | @staticmethod |
| 13 | def forward(ctx, input_, alpha): |
| 14 | ctx.alpha = alpha |
| 15 | return input_ |
| 16 | |
| 17 | @staticmethod |
| 18 | def backward(ctx, grad_output): |
| 19 | output = grad_output.neg() * ctx.alpha |
| 20 | return output, None |
| 21 | |
| 22 | |
| 23 | class Attention(nn.Module): |
nothing calls this directly
no outgoing calls
no test coverage detected