class_docstr: Base class shared by Tacotron and Tacotron2
docstr: Generic test run for `tts` models used by `Trainer`.
  
  You can override this for a different behaviour.
  
  Args:
      assets (dict): A dict of training assets. For `tts` models, it must include `{'audio_processor': ap}`.
  
  Returns:
      Tuple[Dict, Dict]: Test figures and audios to be projected to Tensorboard.
docstr_tok: ["Generic","test","run","for","`","tts","`","models","used","by","`","Trainer","`",".","You","can","override","this","for","a","different","behaviour",".","Args",":","assets","(","dict",")",":","A","dict","of","training","assets",".","For","`","tts","`","models",",","it","must","include","`","{","'audio_processor","'",":","ap","}","`",".","Returns",":","Tuple","[","Dict",",","Dict","]",":","Test","figures","and","audios","to","be","projected","to","Tensorboard","."]
code: def test_run(self, assets: Dict) -> Tuple[Dict, Dict]:
      """Generic test run for `tts` models used by `Trainer`.
  
      You can override this for a different behaviour.
  
      Args:
          assets (dict): A dict of training assets. For `tts` models, it must include `{'audio_processor': ap}`.
  
      Returns:
          Tuple[Dict, Dict]: Test figures and audios to be projected to Tensorboard.
      """
      print(" | > Synthesizing test sentences.")
      test_audios = {}
      test_figures = {}
      test_sentences = self.config.test_sentences
      aux_inputs = self._get_test_aux_input()
      for idx, sen in enumerate(test_sentences):
          outputs_dict = synthesis(
              self,
              sen,
              self.config,
              "cuda" in str(next(self.parameters()).device),
              speaker_id=aux_inputs["speaker_id"],
              d_vector=aux_inputs["d_vector"],
              style_wav=aux_inputs["style_wav"],
              use_griffin_lim=True,
              do_trim_silence=False,
          )
          test_audios["{}-audio".format(idx)] = outputs_dict["wav"]
          test_figures["{}-prediction".format(idx)] = plot_spectrogram(
              outputs_dict["outputs"]["model_outputs"],
              self.ap,
              output_fig=False,
          )
          test_figures["{}-alignment".format(idx)] = plot_alignment(
              outputs_dict["outputs"]["alignments"], output_fig=False
          )
      return {"figures": test_figures, "audios": test_audios}
  
imports: import copy
  from abc import abstractmethod
  from typing import Dict, Tuple
  import torch
  from coqpit import Coqpit
  from torch import nn
  from TTS.tts.layers.losses import TacotronLoss
  from TTS.tts.models.base_tts import BaseTTS
  from TTS.tts.utils.helpers import sequence_mask
  from TTS.tts.utils.speakers import SpeakerManager
  from TTS.tts.utils.synthesis import synthesis
  from TTS.tts.utils.text.tokenizer import TTSTokenizer
  from TTS.tts.utils.visual import plot_alignment, plot_spectrogram
  from TTS.utils.generic_utils import format_aux_input
  from TTS.utils.io import load_fsspec
  from TTS.utils.training import gradual_training_scheduler
label_desc: Use image node_id 10 for calling the BaseTacotron obj's underlying member method code with example usage: obj.test_run(assets) and returns: dict