MCPcopy Create free account
hub / github.com/AtlasAnalyticsLab/AdaFisher / PreNorm

Class PreNorm

Image_Classification/src/models/swin.py:27–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25
26
27class PreNorm(nn.Module):
28 def __init__(self, dim, fn):
29 super().__init__()
30 self.norm = nn.LayerNorm(dim)
31 self.fn = fn
32
33 def forward(self, x, **kwargs):
34 return self.fn(self.norm(x), **kwargs)
35
36
37class FeedForward(nn.Module):

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected