code: def _check_forward_outputs(
      self, config, output_dict, encoder_config=None, batch_size=2
  ):
      self.assertEqual(
          output_dict["model_outputs"].shape[2],
          config.model_args.spec_segment_size
          * config.audio["hop_length"],
      )
      self.assertEqual(
          output_dict["alignments"].shape, (batch_size, 128, 30)
      )
      self.assertEqual(output_dict["alignments"].max(), 1)
      self.assertEqual(output_dict["alignments"].min(), 0)
      self.assertEqual(
          output_dict["z"].shape,
          (batch_size, config.model_args.hidden_channels, 30),
      )
      self.assertEqual(
          output_dict["z_p"].shape,
          (batch_size, config.model_args.hidden_channels, 30),
      )
      self.assertEqual(
          output_dict["m_p"].shape,
          (batch_size, config.model_args.hidden_channels, 30),
      )
      self.assertEqual(
          output_dict["logs_p"].shape,
          (batch_size, config.model_args.hidden_channels, 30),
      )
      self.assertEqual(
          output_dict["m_q"].shape,
          (batch_size, config.model_args.hidden_channels, 30),
      )
      self.assertEqual(
          output_dict["logs_q"].shape,
          (batch_size, config.model_args.hidden_channels, 30),
      )
      self.assertEqual(
          output_dict["waveform_seg"].shape[2],
          config.model_args.spec_segment_size
          * config.audio["hop_length"],
      )
      if encoder_config:
          self.assertEqual(
              output_dict["gt_spk_emb"].shape,
              (batch_size, encoder_config.model_params["proj_dim"]),
          )
          self.assertEqual(
              output_dict["syn_spk_emb"].shape,
              (batch_size, encoder_config.model_params["proj_dim"]),
          )
      else:
          self.assertEqual(output_dict["gt_spk_emb"], None)
          self.assertEqual(output_dict["syn_spk_emb"], None)
  
imports: import copy
  import os
  import unittest
  import torch
  from trainer.logging.tensorboard_logger import TensorboardLogger
  from tests import assertHasAttr, assertHasNotAttr, get_tests_data_path, get_tests_input_path, get_tests_output_path
  from TTS.config import load_config
  from TTS.encoder.utils.generic_utils import setup_encoder_model
  from TTS.tts.configs.vits_config import VitsConfig
  from TTS.tts.models.vits import Vits, VitsArgs, VitsAudioConfig, amp_to_db, db_to_amp, load_audio, spec_to_mel, wav_to_mel, wav_to_spec
  from TTS.tts.utils.speakers import SpeakerManager
label_desc: Use image node_id 8 for calling the TestVits obj's underlying member method code with example usage: obj._check_forward_outputs(config, output_dict, encoder_config, batch_size) without return types