class_docstr: FastPitch based model that can synthesize mel spectrograms from content and speaker embeddings
  obtained from SSLDisentangler. This model can be used for voice conversion by swapping the speaker embedding 
  of a given source utterance, with the speaker embedding of a target speaker.
class_docstr_tok: ["FastPitch","based","model","that","can","synthesize","mel","spectrograms","from","content","and","speaker","embeddings","obtained","from","SSLDisentangler",".","This","model","can","be","used","for","voice","conversion","by","swapping","the","speaker","embedding","of","a","given","source","utterance",",","with","the","speaker","embedding","of","a","target","speaker","."]
docstr: Args:
      content_embedding : Content embedding from SSL backbone (B, C, T) 
      speaker_embedding : Speaker embedding from SSL backbone (B, C)
      pitch_contour : Normalized Pitch contour derived from the mel spectrogram
      encoded_len: Length of each content embedding, optional if batch size is 1. 
      compute_pitch: if true, predict pitch contour from content and speaker embedding.
      compute_duration: if true, predict duration from content and speaker embedding.
      durs_gt: Ground truth duration of each content embedding, ignored if compute_duration is True.
      dataset_id: Dataset id if training is conditioned on multiple datasets
  Returns:
      List of waveforms
docstr_tok: ["Args",":","content_embedding",":","Content","embedding","from","SSL","backbone","(","B",",","C",",","T",")","speaker_embedding",":","Speaker","embedding","from","SSL","backbone","(","B",",","C",")","pitch_contour",":","Normalized","Pitch","contour","derived","from","the","mel","spectrogram","encoded_len",":","Length","of","each","content","embedding",",","optional","if","batch","size","is","1.","compute_pitch",":","if","true",",","predict","pitch","contour","from","content","and","speaker","embedding",".","compute_duration",":","if","true",",","predict","duration","from","content","and","speaker","embedding",".","durs_gt",":","Ground","truth","duration","of","each","content","embedding",",","ignored","if","compute_duration","is","True",".","dataset_id",":","Dataset","id","if","training","is","conditioned","on","multiple","datasets","Returns",":","List","of","waveforms"]
code: def generate_wav(
      self,
      content_embedding,
      speaker_embedding,
      encoded_len=None,
      pitch_contour=None,
      compute_pitch=False,
      compute_duration=False,
      durs_gt=None,
      dataset_id=0,
  ):
      """
      Args:
          content_embedding : Content embedding from SSL backbone (B, C, T)
          speaker_embedding : Speaker embedding from SSL backbone (B, C)
          pitch_contour : Normalized Pitch contour derived from the mel spectrogram
          encoded_len: Length of each content embedding, optional if batch size is 1.
          compute_pitch: if true, predict pitch contour from content and speaker embedding.
          compute_duration: if true, predict duration from content and speaker embedding.
          durs_gt: Ground truth duration of each content embedding, ignored if compute_duration is True.
          dataset_id: Dataset id if training is conditioned on multiple datasets
      Returns:
          List of waveforms
      """
      _bs, _, _n_time = content_embedding.size()
      if encoded_len is None:
          encoded_len = (
              (torch.ones(_bs) * _n_time).long().to(self.device)
          )
  
      dataset_id = (torch.ones(_bs) * dataset_id).long().to(self.device)
      enc_out = self.compute_encoding(
          content_embedding, speaker_embedding, dataset_id=dataset_id
      )
      if self.use_encoder:
          enc_out, _ = self.encoder(input=enc_out, seq_lens=encoded_len)
  
      enc_mask = mask_from_lens(encoded_len)
  
      if compute_duration:
          durs = None
      elif durs_gt is not None:
          durs = durs_gt
      else:
          ssl_downsampling_factor = self._cfg.get(
              "ssl_downsampling_factor", 4
          )  # backward compatibility
          durs = torch.ones_like(enc_mask) * ssl_downsampling_factor
  
      enc_mask = enc_mask[:, :, None]
      if pitch_contour is not None and compute_pitch == False:
          if durs_gt is not None:
              pitch = average_features(
                  pitch_contour.unsqueeze(1), durs_gt
              ).squeeze(1)
          elif durs is not None:
              pitch = average_features(
                  pitch_contour.unsqueeze(1), durs
              ).squeeze(1)
          else:
              raise ValueError("durs or durs_gt must be provided")
  
      else:
          pitch = None
  
      mels_pred, *_ = self(
          enc_out=enc_out,
          enc_mask=enc_mask,
          durs=durs,
          pitch=pitch,
          pace=1.0,
      )
  
      wavs = []
      for idx in range(_bs):
          mel_pred = mels_pred[idx].data.cpu().float().numpy()
          wav = self.vocode_spectrogram(mel_pred)
          wavs.append(wav)
  
      return wavs
  
imports: import random
  from typing import Iterable
  import torch
  from hydra.utils import instantiate
  from omegaconf import DictConfig
  from pytorch_lightning import Trainer
  from pytorch_lightning.loggers import TensorBoardLogger
  from nemo.collections.tts.losses.fastpitchloss import DurationLoss, MelLoss, PitchLoss
  from nemo.collections.tts.modules.fastpitch import FastPitchSSLModule, average_features
  from nemo.collections.tts.modules.transformer import mask_from_lens
  from nemo.collections.tts.parts.utils.helpers import plot_multipitch_to_numpy, plot_spectrogram_to_numpy
  from nemo.core.classes import ModelPT
  from nemo.core.classes.common import PretrainedModelInfo
  from nemo.utils import logging, model_utils
  from nemo.utils.decorators import experimental
label_desc: Use image node_id 9 for calling the FastPitchModel_SSL obj's underlying member method code with example usage: obj.generate_wav(content_embedding, speaker_embedding, encoded_len, pitch_contour, compute_pitch, compute_duration, durs_gt, dataset_id) and returns: wavs