docstr: Verify that scripting RNNTBeamSearch does not change the behavior of method `infer`.
code: def test_torchscript_consistency_infer(self):
      r"""Verify that scripting RNNTBeamSearch does not change the behavior of method `infer`."""
  
      input_config = self._get_input_config()
      segment_length = input_config["segment_length"]
      right_context_length = input_config["right_context_length"]
      input_dim = input_config["input_dim"]
      num_symbols = input_config["num_symbols"]
      blank_idx = num_symbols - 1
      beam_width = 5
  
      input = torch.rand(
          segment_length + right_context_length, input_dim
      ).to(device=self.device, dtype=self.dtype)
      lengths = torch.randint(
          1, segment_length + right_context_length + 1, ()
      ).to(device=self.device, dtype=torch.int32)
  
      model = self._get_model()
  
      state, hypo = None, None
      scripted_state, scripted_hypo = None, None
      for _ in range(2):
          beam_search = RNNTBeamSearch(model, blank_idx)
          scripted = torch_script(beam_search)
  
          res = beam_search.infer(
              input, lengths, beam_width, state=state, hypothesis=hypo
          )
          scripted_res = scripted.infer(
              input,
              lengths,
              beam_width,
              state=scripted_state,
              hypothesis=scripted_hypo,
          )
  
          self.assertEqual(res, scripted_res)
  
          state = res[1]
          hypo = res[0]
  
          scripted_state = scripted_res[1]
          scripted_hypo = scripted_res[0]
  
file_path: audio/test/torchaudio_unittest/models/rnnt_decoder/rnnt_decoder_test_impl.py
imports: import torch
  from torchaudio.models import emformer_rnnt_model, RNNTBeamSearch
  from torchaudio_unittest.common_utils import TestBaseMixin, torch_script
label_desc: Use image node_id 5 for calling the RNNTBeamSearchTestImpl obj's underlying member method code with example usage: obj.test_torchscript_consistency_infer() without return types