class_docstr: Class that manages the training loop. See speechbrain.core.Brain.
class_docstr_tok: ["Class","that","manages","the","training","loop",".","See","speechbrain.core.Brain","."]
docstr: Saves a single wav
  Arguments
  ---------
  name: str
      the name of the saved audio
  data: torch.Tensor
      the  wave data to save
  epoch: int or str
      the epoch number (used in file path calculations)
      or "test" for test stage
docstr_tok: ["Saves","a","single","wav","Arguments","--","--","--","--","-","name",":","str","the","name","of","the","saved","audio","data",":","torch.Tensor","the","wave","data","to","save","epoch",":","int","or","str","the","epoch","number","(","used","in","file","path","calculations",")","or","``","test","''","for","test","stage"]
code: def save_audio(self, name, data, epoch):
      """Saves a single wav
      Arguments
      ---------
      name: str
          the name of the saved audio
      data: torch.Tensor
          the  wave data to save
      epoch: int or str
          the epoch number (used in file path calculations)
          or "test" for test stage
      """
      target_path = os.path.join(
          self.hparams.progress_sample_path, str(epoch)
      )
      if not os.path.exists(target_path):
          os.makedirs(target_path)
      file_name = f"{name}.wav"
      effective_file_name = os.path.join(target_path, file_name)
      torchaudio.save(effective_file_name, data.cpu(), 22050)
  
file_path: speechbrain/recipes/LJSpeech/TTS/vocoder/diffwave/train.py
imports: import torchaudio
  import logging
  import sys
  import torch
  import speechbrain
  import os
  from hyperpyyaml import load_hyperpyyaml
label_desc: Use image node_id 7 for calling the DiffWaveBrain obj's underlying member method code with example usage: obj.save_audio(name, data, epoch) without return types