MCPcopy Create free account
hub / github.com/UX-Decoder/Semantic-SAM / forward

Method forward

semantic_sam/language/LangEncoder/transformer.py:30–36  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

28 self.variance_epsilon = eps
29
30 def forward(self, x):
31 pdtype = x.dtype
32 x = x.float()
33 u = x.mean(-1, keepdim=True)
34 s = (x - u).pow(2).mean(-1, keepdim=True)
35 x = (x - u) / torch.sqrt(s + self.variance_epsilon)
36 return self.weight * x.to(pdtype) + self.bias
37
38
39class QuickGELU(nn.Module):

Callers

nothing calls this directly

Calls 1

toMethod · 0.80

Tested by

no test coverage detected