docstr: Check that method `infer` produces correctly-shaped outputs.
docstr_tok: ["Check","that","method","`","infer","`","produces","correctly-shaped","outputs","."]
code: def test_output_shape_infer(self):
      r"""Check that method `infer` produces correctly-shaped outputs."""
      input_dim = 256
      batch_size = 5
      num_frames = 6
      right_context_length = 2
  
      emformer = self.gen_model(input_dim, right_context_length).eval()
  
      state = None
      for _ in range(3):
          input, lengths = self.gen_inputs(
              input_dim, batch_size, num_frames, right_context_length
          )
          output, output_lengths, state = emformer.infer(
              input, lengths, state
          )
          self.assertEqual(
              (
                  batch_size,
                  num_frames - right_context_length,
                  input_dim,
              ),
              output.shape,
          )
          self.assertEqual((batch_size,), output_lengths.shape)
  
file_path: audio/test/torchaudio_unittest/models/emformer/emformer_test_impl.py
imports: from abc import ABC, abstractmethod
  import torch
  from torchaudio.models import Emformer
  from torchaudio_unittest.common_utils import TestBaseMixin, torch_script
label_desc: Use image node_id 7 for calling the EmformerTestMixin obj's underlying member method code with example usage: obj.test_output_shape_infer() without return types