MCPcopy Create free account
hub / github.com/ICTMCG/FakeSV / ReverseLayerF

Class ReverseLayerF

code/models/layers.py:11–20  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9
10
11class 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
23class Attention(nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected