def forward(self, prev_output_tokens, encoder_out=None, incremental_state=None, **unused):
    "\n        Args:\n            prev_output_tokens (LongTensor): previous decoder outputs of shape\n                `(batch, tgt_len)`, for teacher forcing\n            encoder_out (Tensor, optional): output from the encoder, used for\n                encoder-side attention\n            incremental_state (dict): dictionary used for storing state during\n                :ref:`Incremental decoding`\n\n        Returns:\n            tuple:\n                - the decoder's output of shape `(batch, tgt_len, vocab)`\n                - a dictionary with any model-specific outputs\n        "
    prev_output_tokens = prev_output_tokens.long()
    (x, extra) = self.extract_features(prev_output_tokens, encoder_out, incremental_state)
    x = self.output_layer(x)
    return (x, extra)
Args:
    prev_output_tokens (LongTensor): previous decoder outputs of shape
        `(batch, tgt_len)`, for teacher forcing
    encoder_out (Tensor, optional): output from the encoder, used for
        encoder-side attention
    incremental_state (dict): dictionary used for storing state during
        :ref:`Incremental decoding`

Returns:
    tuple:
        - the decoder's output of shape `(batch, tgt_len, vocab)`
        - a dictionary with any model-specific outputs
def forward(self, prev_output_tokens, encoder_out=None, incremental_state=None, **unused):
    "\n        Args:\n            prev_output_tokens (LongTensor): previous decoder outputs of shape\n                `(batch, tgt_len)`, for teacher forcing\n            encoder_out (Tensor, optional): output from the encoder, used for\n                encoder-side attention\n            incremental_state (dict): dictionary used for storing state during\n                :ref:`Incremental decoding`\n\n        Returns:\n            tuple:\n                - the decoder's output of shape `(batch, tgt_len, vocab)`\n                - a dictionary with any model-specific outputs\n        "
    prev_output_tokens = prev_output_tokens.long()
    (x, extra) = self.extract_features(prev_output_tokens, encoder_out, incremental_state)
    x = self.output_layer(x)
    return (x, extra)