code: def forward(
      self,
      src_tokens: torch.Tensor,
      dict_feat: Optional[
          Tuple[torch.Tensor, torch.Tensor, torch.Tensor]
      ],
      contextual_token_embedding: Optional[torch.Tensor],
      src_lengths: torch.Tensor,
  ) -> List[
      Tuple[
          torch.Tensor, float, List[float], torch.Tensor, torch.Tensor
      ]
  ]:
      target_length = get_target_length(
          src_lengths.item(),
          self.targetlen_cap,
          self.targetlen_a,
          self.targetlen_b,
          self.targetlen_c,
      )
  
      (
          all_tokens,
          all_scores,
          all_weights,
          all_prev_indices,
      ) = self.beam_search(
          src_tokens,
          src_lengths,
          target_length,
          dict_feat,
          contextual_token_embedding,
      )
  
      return self.beam_decode(
          all_tokens,
          all_scores,
          all_weights,
          all_prev_indices,
          target_length,
      )
  
file_path: pytext/pytext/torchscript/seq2seq/scripted_seq2seq_generator.py
imports: from typing import Dict, List, Optional, Tuple
  import torch
  from pytext.config import ConfigBase
  from pytext.models.module import Module
  from pytext.torchscript.seq2seq.beam_decode import BeamDecode
  from pytext.torchscript.seq2seq.beam_search import BeamSearch
label_desc: Use image node_id 3 for calling the ScriptedSequenceGenerator obj's underlying member method code with example usage: obj.forward(src_tokens, dict_feat, contextual_token_embedding, src_lengths) and returns: self