MCPcopy Create free account
hub / github.com/OpenGVLab/HumanBench / __init__

Method __init__

PATH/core/models/necks/simple_fpn.py:21–31  ·  view source on GitHub ↗
(self, embed_dim, eps=1e-6)

Source from the content-addressed store, hash-verified

19 """
20
21 def __init__(self, embed_dim, eps=1e-6):
22 super().__init__()
23 self.weight = nn.Parameter(torch.ones(embed_dim))
24 self.bias = nn.Parameter(torch.zeros(embed_dim))
25 self.eps = eps
26 self.normalized_shape = (embed_dim,)
27
28 # >>> workaround for compatability
29 self.ln = nn.LayerNorm(embed_dim, eps=1e-6)
30 self.ln.weight = self.weight
31 self.ln.bias = self.bias
32
33 def forward(self, x):
34 u = x.mean(1, keepdim=True)

Callers 12

__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected