docstr: Verify that scripting RNNT does not change the behavior of method `forward`.
docstr_tok: ["Verify","that","scripting","RNNT","does","not","change","the","behavior","of","method","`","forward","`","."]
code: def test_torchscript_consistency_forward(self):
      r"""Verify that scripting RNNT does not change the behavior of method `forward`."""
      inputs, input_lengths = self._get_transcriber_input()
      targets, target_lengths = self._get_predictor_input()
  
      rnnt = self._get_model()
      scripted = torch_script(rnnt).eval()
  
      ref_state, scripted_state = None, None
      for _ in range(2):
          (
              ref_out,
              ref_input_lengths,
              ref_target_lengths,
              ref_state,
          ) = rnnt(
              inputs, input_lengths, targets, target_lengths, ref_state
          )
          (
              scripted_out,
              scripted_input_lengths,
              scripted_target_lengths,
              scripted_state,
          ) = scripted(
              inputs,
              input_lengths,
              targets,
              target_lengths,
              scripted_state,
          )
  
          self.assertEqual(ref_out, scripted_out, atol=1e-4, rtol=1e-5)
          self.assertEqual(
              ref_input_lengths,
              scripted_input_lengths,
              atol=1e-4,
              rtol=1e-5,
          )
          self.assertEqual(
              ref_target_lengths,
              scripted_target_lengths,
              atol=1e-4,
              rtol=1e-5,
          )
          self.assertEqual(
              ref_state, scripted_state, atol=1e-4, rtol=1e-5
          )
  
file_path: audio/test/torchaudio_unittest/prototype/rnnt_test_impl.py
imports: import torch
  from torchaudio.prototype.models import conformer_rnnt_model
  from torchaudio_unittest.common_utils import TestBaseMixin, torch_script
label_desc: Use image node_id 8 for calling the ConformerRNNTTestImpl obj's underlying member method code with example usage: obj.test_torchscript_consistency_forward() without return types