(self, x, src_mask=None)
| 48 | self.ln2 = nn.LayerNorm(embed_dim) |
| 49 | |
| 50 | def forward(self, x, src_mask=None): |
| 51 | attn_output, _ = self.attention(x, x, x, attn_mask=src_mask) |
| 52 | x = self.ln1(x + attn_output) |
| 53 | ff_output = self.ff(x) |
| 54 | x = self.ln2(x + ff_output) |
| 55 | return x |
| 56 | |
| 57 | class Encoder(nn.Module): |
| 58 | def __init__(self, embed_dim, n_blocks, n_heads, dropout): |
nothing calls this directly
no outgoing calls
no test coverage detected