(self, x, mask)
| 68 | self.norm2 = nn.LayerNorm(dim, eps=eps) |
| 69 | |
| 70 | def forward(self, x, mask): |
| 71 | if self.post_norm: |
| 72 | x = self.norm1(x + self.attn(x, mask)) |
| 73 | x = self.norm2(x + self.ffn(x)) |
| 74 | else: |
| 75 | x = x + self.attn(self.norm1(x), mask) |
| 76 | x = x + self.ffn(self.norm2(x)) |
| 77 | return x |
| 78 | |
| 79 | |
| 80 | class XLMRoberta(nn.Module): |
nothing calls this directly
no outgoing calls
no test coverage detected