class_docstr: Sequence to sequence model using an encoder-decoder architecture.
class_docstr_tok: ["Sequence","to","sequence","model","using","an","encoder-decoder","architecture","."]
code: def forward(
      self,
      src_tokens: torch.Tensor,
      dict_feats: Optional[
          Tuple[torch.Tensor, torch.Tensor, torch.Tensor]
      ],
      contextual_token_embedding: Optional[torch.Tensor],
      src_lengths: torch.Tensor,
      trg_tokens: torch.Tensor,
  ):
      additional_features: List[List[torch.Tensor]] = []
  
      if dict_feats:
          additional_features.append(list(dict_feats))
  
      if contextual_token_embedding is not None:
          additional_features.append([contextual_token_embedding])
  
      logits, output_dict = self.model(
          src_tokens, additional_features, src_lengths, trg_tokens
      )
  
      if dict_feats:
          (
              output_dict["dict_tokens"],
              output_dict["dict_weights"],
              output_dict["dict_lengths"],
          ) = dict_feats
  
      if contextual_token_embedding is not None:
          output_dict[
              "contextual_token_embedding"
          ] = contextual_token_embedding
  
      return logits, output_dict
  
imports: from typing import Callable, Dict, List, Optional, Tuple
  import torch
  from pytext.common.constants import Stage
  from pytext.data.tensorizers import ByteTokenTensorizer, GazetteerTensorizer, Tensorizer, TokenTensorizer
  from pytext.data.utils import Vocabulary
  from pytext.models.embeddings import ContextualTokenEmbedding, DictEmbedding, WordEmbedding
  from pytext.models.embeddings.scriptable_embedding_list import ScriptableEmbeddingList
  from pytext.models.model import BaseModel, Model
  from pytext.models.module import create_module
  from pytext.torchscript.seq2seq.export_model import Seq2SeqJIT
  from pytext.torchscript.seq2seq.scripted_seq2seq_generator import ScriptedSequenceGenerator
  from pytext.utils.cuda import GetTensor
  from pytext.utils.usage import log_class_usage
  from .rnn_encoder_decoder import RNNModel
  from .seq2seq_output_layer import Seq2SeqOutputLayer
label_desc: Use image node_id 6 for calling the Seq2SeqModel obj's underlying member method code with example usage: obj.forward(src_tokens, dict_feats, contextual_token_embedding, src_lengths, trg_tokens) and returns: logits,  output_dict