code: def test_generator(self):
      model = Seq2SeqModel.from_config(
          Seq2SeqModel.Config(
              source_embedding=WordEmbedding.Config(embed_dim=512),
              target_embedding=WordEmbedding.Config(embed_dim=512),
          ),
          self._get_tensorizers(),
      )
      sample, _ = get_example_and_check()
      repacked_inputs = {
          "src_tokens": sample[0].t(),
          "src_lengths": sample[1],
      }
  
      scripted_generator = ScriptedSequenceGenerator(
          [model.model],
          model.trg_eos_index,
          ScriptedSequenceGenerator.Config(),
      )
      scripted_preds = scripted_generator.generate_hypo(repacked_inputs)
  
      self.assertIsNotNone(scripted_preds)
  
file_path: pytext/pytext/models/test/scripted_seq2seq_generator_test.py
imports: import unittest
  import numpy
  import torch
  from pytext.data.sources.tsv import TSVDataSource
  from pytext.data.tensorizers import initialize_tensorizers, TokenTensorizer
  from pytext.models.embeddings.word_embedding import WordEmbedding
  from pytext.models.seq_models.seq2seq_model import Seq2SeqModel
  from pytext.torchscript.seq2seq.scripted_seq2seq_generator import ScriptedSequenceGenerator
  from pytext.utils.test import import_tests_module
label_desc: Use image node_id 2 for calling the ScriptedSeq2SeqGeneratorTest obj's underlying member method code with example usage: obj.test_generator() without return types