code: def generate_hypo(self, tensors: Dict[str, torch.Tensor]):
      actual_src_tokens = tensors["src_tokens"].t()
      dict_feat: Optional[
          Tuple[torch.Tensor, torch.Tensor, torch.Tensor]
      ] = None
  
      if "dict_tokens" in tensors:
          dict_feat = (
              tensors["dict_tokens"],
              tensors["dict_weights"],
              tensors["dict_lengths"],
          )
  
      contextual_token_embedding: Optional[torch.Tensor] = None
      if "contextual_token_embedding" in tensors:
          contextual_token_embedding = tensors[
              "contextual_token_embedding"
          ]
  
      hypos_etc = self.forward(
          actual_src_tokens,
          dict_feat,
          contextual_token_embedding,
          tensors["src_lengths"],
      )
      predictions = [[pred for pred, _, _, _, _ in hypos_etc]]
      scores = [[score for _, score, _, _, _ in hypos_etc]]
      return (predictions, scores)
  
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 4 for calling the ScriptedSequenceGenerator obj's underlying member method code with example usage: obj.generate_hypo(tensors) and returns: predictions,  scores