MCPcopy Create free account
hub / github.com/THUDM/GLM / forward

Method forward

model/modeling_bert.py:280–284  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

278 self.variance_epsilon = eps
279
280 def forward(self, x):
281 u = x.mean(-1, keepdim=True)
282 s = (x - u).pow(2).mean(-1, keepdim=True)
283 x = (x - u) / torch.sqrt(s + self.variance_epsilon)
284 return self.weight * x + self.bias
285
286
287class BertEmbeddings(nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected