class_docstr: Represents an encoder-decoder model.
class_docstr_tok: ["Represents","an","encoder-decoder","model","."]
docstr: Decode the specified target sequences.
  
  :param seqs:
      The target sequences to decode. *Shape:* :math:`(N,S_{tgt},*)`,
      where :math:`N` is the batch size, :math:`S_{tgt}` is the target
      sequence length, and :math:`*` is any number of sequence-specific
      dimensions including none.
  :param padding_mask:
      The padding mask of ``seqs``. *Shape:* :math:`(N,S)`, where :math:`N`
      is the batch size and :math:`S` is the sequence length.
  :param encoder_output:
      The encoder output to use in encoder-decoder attention. *Shape:*
      :math:`(N,S_{enc},M)`, where :math:`N` is the batch size,
      :math:`S_{enc}` is the encoder output sequence length, and :math:`M`
      is the dimensionality of the model.
  :param encoder_padding_mask:
      The padding mask of ``encoder_output``. *Shape:* :math:`(N,S_{enc})`,
      where :math:`N` is the batch size and :math:`S_{enc}` is the encoder
      output sequence length.
  :param state_bag:
      The state bag to use for incremental decoding.
  
  :returns:
      - The decoder output. *Shape:* :math:`(N,S_{tgt},M)`, where
        :math:`N` is the batch size, :math:`S_{tgt}` is the target
        sequence length, and :math:`M` is the dimensionality of the model.
      - The padding mask of the decoder output. *Shape:*
        :math:`(N,S_{tgt})`, where :math:`N` is the batch size and
        :math:`S_{tgt}` is the target sequence length.
docstr_tok: ["Decode","the","specified","target","sequences",".",":","param","seqs",":","The","target","sequences","to","decode",".","*","Shape",":","*",":","math",":","`","(","N",",","S_","{","tgt","}",",","*",")","`",",","where",":","math",":","`","N","`","is","the","batch","size",",",":","math",":","`","S_","{","tgt","}","`","is","the","target","sequence","length",",","and",":","math",":","`","*","`","is","any","number","of","sequence-specific","dimensions","including","none",".",":","param","padding_mask",":","The","padding","mask","of","``","seqs","``",".","*","Shape",":","*",":","math",":","`","(","N",",","S",")","`",",","where",":","math",":","`","N","`","is","the","batch","size","and",":","math",":","`","S","`","is","the","sequence","length",".",":","param","encoder_output",":","The","encoder","output","to","use","in","encoder-decoder","attention",".","*","Shape",":","*",":","math",":","`","(","N",",","S_","{","enc","}",",","M",")","`",",","where",":","math",":","`","N","`","is","the","batch","size",",",":","math",":","`","S_","{","enc","}","`","is","the","encoder","output","sequence","length",",","and",":","math",":","`","M","`","is","the","dimensionality","of","the","model",".",":","param","encoder_padding_mask",":","The","padding","mask","of","``","encoder_output","``",".","*","Shape",":","*",":","math",":","`","(","N",",","S_","{","enc","}",")","`",",","where",":","math",":","`","N","`","is","the","batch","size","and",":","math",":","`","S_","{","enc","}","`","is","the","encoder","output","sequence","length",".",":","param","state_bag",":","The","state","bag","to","use","for","incremental","decoding",".",":","returns",":","-","The","decoder","output",".","*","Shape",":","*",":","math",":","`","(","N",",","S_","{","tgt","}",",","M",")","`",",","where",":","math",":","`","N","`","is","the","batch","size",",",":","math",":","`","S_","{","tgt","}","`","is","the","target","sequence","length",",","and",":","math",":","`","M","`","is","the","dimensionality","of","the","model",".","-","The","padding","mask","of","the","decoder","output",".","*","Shape",":","*",":","math",":","`","(","N",",","S_","{","tgt","}",")","`",",","where",":","math",":","`","N","`","is","the","batch","size","and",":","math",":","`","S_","{","tgt","}","`","is","the","target","sequence","length","."]
code: def decode(
      self,
      seqs: Tensor,
      padding_mask: Optional[PaddingMask],
      encoder_output: Tensor,
      encoder_padding_mask: Optional[PaddingMask],
      *,
      state_bag: Optional[IncrementalStateBag] = None,
  ) -> Tuple[Tensor, Optional[PaddingMask]]:
      """Decode the specified target sequences.
  
      :param seqs:
          The target sequences to decode. *Shape:* :math:`(N,S_{tgt},*)`,
          where :math:`N` is the batch size, :math:`S_{tgt}` is the target
          sequence length, and :math:`*` is any number of sequence-specific
          dimensions including none.
      :param padding_mask:
          The padding mask of ``seqs``. *Shape:* :math:`(N,S)`, where :math:`N`
          is the batch size and :math:`S` is the sequence length.
      :param encoder_output:
          The encoder output to use in encoder-decoder attention. *Shape:*
          :math:`(N,S_{enc},M)`, where :math:`N` is the batch size,
          :math:`S_{enc}` is the encoder output sequence length, and :math:`M`
          is the dimensionality of the model.
      :param encoder_padding_mask:
          The padding mask of ``encoder_output``. *Shape:* :math:`(N,S_{enc})`,
          where :math:`N` is the batch size and :math:`S_{enc}` is the encoder
          output sequence length.
      :param state_bag:
          The state bag to use for incremental decoding.
  
      :returns:
          - The decoder output. *Shape:* :math:`(N,S_{tgt},M)`, where
            :math:`N` is the batch size, :math:`S_{tgt}` is the target
            sequence length, and :math:`M` is the dimensionality of the model.
          - The padding mask of the decoder output. *Shape:*
            :math:`(N,S_{tgt})`, where :math:`N` is the batch size and
            :math:`S_{tgt}` is the target sequence length.
      """
  
file_path: fairseq2/src/fairseq2/models/encoder_decoder.py
imports: from abc import abstractmethod
  from typing import Optional, Tuple
  from torch import Tensor
  from fairseq2.data import VocabularyInfo
  from fairseq2.models.seq2seq import Seq2SeqBatch, Seq2SeqModel
  from fairseq2.models.sequence import SequenceModelOutput
  from fairseq2.nn.incremental_state import IncrementalStateBag
  from fairseq2.nn.padding import PaddingMask
  from fairseq2.typing import override
label_desc: Use image node_id 4 for calling the EncoderDecoderModel obj's underlying member method code with example usage: obj.decode(seqs, padding_mask, encoder_output, encoder_padding_mask) without return types