(self, x, mask)
| 30 | self.gelu = nn.GELU() |
| 31 | |
| 32 | def __call__(self, x, mask): |
| 33 | attention_out = self.attention(x, x, x, mask) |
| 34 | add_and_norm = self.ln1(x + attention_out) |
| 35 | |
| 36 | ff = self.linear1(add_and_norm) |
| 37 | ff_gelu = self.gelu(ff) |
| 38 | ff_out = self.linear2(ff_gelu) |
| 39 | x = self.ln2(ff_out + add_and_norm) |
| 40 | |
| 41 | return x |
| 42 | |
| 43 | |
| 44 | class TransformerEncoder(nn.Module): |
nothing calls this directly
no outgoing calls
no test coverage detected