(self, x, enc_output, tgt_mask=None, memory_mask=None)
| 80 | self.ln3 = nn.LayerNorm(embed_dim) |
| 81 | |
| 82 | def forward(self, x, enc_output, tgt_mask=None, memory_mask=None): |
| 83 | self_attn_output, _ = self.self_attention(x, x, x, attn_mask=tgt_mask) |
| 84 | x = self.ln1(x + self_attn_output) |
| 85 | enc_dec_attn_output, _ = self.enc_dec_attention(x, enc_output, enc_output, attn_mask=memory_mask) |
| 86 | x = self.ln2(x + enc_dec_attn_output) |
| 87 | ff_output = self.ff(x) |
| 88 | x = self.ln3(x + ff_output) |
| 89 | return x |
| 90 | |
| 91 | class Decoder(nn.Module): |
| 92 | def __init__(self, embed_dim, n_blocks, n_heads, dropout): |
nothing calls this directly
no outgoing calls
no test coverage detected