class_docstr: The Brain implementation for Tacotron2
class_docstr_tok: ["The","Brain","implementation","for","Tacotron2"]
docstr: Produces a sample in inference mode. This is called when producing
  samples and can be useful because
docstr_tok: ["Produces","a","sample","in","inference","mode",".","This","is","called","when","producing","samples","and","can","be","useful","because"]
code: def run_inference_sample(self):
      """Produces a sample in inference mode. This is called when producing
      samples and can be useful because"""
      if self.last_batch is None:
          return
      inputs, _, _, _, _ = self.last_batch
      text_padded, input_lengths, _, _, _ = inputs
      mel_out, _, _ = self.hparams.model.infer(
          text_padded[:1], input_lengths[:1]
      )
      self.hparams.progress_sample_logger.remember(
          inference_mel_out=self._get_spectrogram_sample(mel_out)
      )
  
file_path: speechbrain/recipes/LJSpeech/TTS/tacotron2/train.py
imports: import torch
  import speechbrain
  import sys
  import logging
  from hyperpyyaml import load_hyperpyyaml
  from speechbrain.utils.text_to_sequence import text_to_sequence
  from speechbrain.utils.data_utils import scalarize
label_desc: Use image node_id 10 for calling the Tacotron2Brain obj's underlying member method code with example usage: obj.run_inference_sample() without return types