(self, x)
| 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 | |
| 287 | class BertEmbeddings(nn.Module): |
nothing calls this directly
no outgoing calls
no test coverage detected