def forward(self, x, encoder_output, encoder_mask):
    decoder_mask = self._create_selfattn_mask(x)
    residual = x
    x = self.self_attention(query=x, mask=decoder_mask)
    x = (x + residual)
    x = _normalize(x, self.norm1)
    residual = x
    x = self.encoder_attention(query=x, key=encoder_output, value=encoder_output, mask=encoder_mask)
    x = (residual + x)
    x = _normalize(x, self.norm2)
    residual = x
    x = self.ffn(x)
    x = (residual + x)
    x = _normalize(x, self.norm3)
    return x
def forward(self, x, encoder_output, encoder_mask):
    decoder_mask = self._create_selfattn_mask(x)
    residual = x
    x = self.self_attention(query=x, mask=decoder_mask)
    x = (x + residual)
    x = _normalize(x, self.norm1)
    residual = x
    x = self.encoder_attention(query=x, key=encoder_output, value=encoder_output, mask=encoder_mask)
    x = (residual + x)
    x = _normalize(x, self.norm2)
    residual = x
    x = self.ffn(x)
    x = (residual + x)
    x = _normalize(x, self.norm3)
    return x