class_docstr: Papaer::
      https://arxiv.org/abs/2210.15418#
  
  Paper Abstract::
      Voice conversion (VC) can be achieved by first extracting source content information and target speaker
      information, and then reconstructing waveform with these information. However, current approaches normally
      either extract dirty content information with speaker information leaked in, or demand a large amount of
      annotated data for training. Besides, the quality of reconstructed waveform can be degraded by the
      mismatch between conversion model and vocoder. In this paper, we adopt the end-to-end framework of VITS for
      high-quality waveform reconstruction, and propose strategies for clean content information extraction without
      text annotation. We disentangle content information by imposing an information bottleneck to WavLM features,
      and propose the spectrogram-resize based data augmentation to improve the purity of extracted content
      information. Experimental results show that the proposed method outperforms the latest VC models trained with
      annotated data and has greater robustness.
  
  Original Code::
      https://github.com/OlaWod/FreeVC
  
  Examples:
      >>> from TTS.vc.configs.freevc_config import FreeVCConfig
      >>> from TTS.vc.models.freevc import FreeVC
      >>> config = FreeVCConfig()
      >>> model = FreeVC(config)
class_docstr_tok: ["Papaer",":",":","https",":","\/\/arxiv.org\/abs\/2210.15418","#","Paper","Abstract",":",":","Voice","conversion","(","VC",")","can","be","achieved","by","first","extracting","source","content","information","and","target","speaker","information",",","and","then","reconstructing","waveform","with","these","information",".","However",",","current","approaches","normally","either","extract","dirty","content","information","with","speaker","information","leaked","in",",","or","demand","a","large","amount","of","annotated","data","for","training",".","Besides",",","the","quality","of","reconstructed","waveform","can","be","degraded","by","the","mismatch","between","conversion","model","and","vocoder",".","In","this","paper",",","we","adopt","the","end-to-end","framework","of","VITS","for","high-quality","waveform","reconstruction",",","and","propose","strategies","for","clean","content","information","extraction","without","text","annotation",".","We","disentangle","content","information","by","imposing","an","information","bottleneck","to","WavLM","features",",","and","propose","the","spectrogram-resize","based","data","augmentation","to","improve","the","purity","of","extracted","content","information",".","Experimental","results","show","that","the","proposed","method","outperforms","the","latest","VC","models","trained","with","annotated","data","and","has","greater","robustness",".","Original","Code",":",":","https",":","\/\/github.com\/OlaWod\/FreeVC","Examples",":",">",">",">","from","TTS.vc.configs.freevc_config","import","FreeVCConfig",">",">",">","from","TTS.vc.models.freevc","import","FreeVC",">",">",">","config","=","FreeVCConfig","(",")",">",">",">","model","=","FreeVC","(","config",")"]
docstr: Forward pass of the model.
  
  Args:
      c: WavLM features. Shape: (batch_size, c_seq_len).
      spec: The input spectrogram. Shape: (batch_size, spec_seq_len, spec_dim).
      g: The speaker embedding. Shape: (batch_size, spk_emb_dim).
      mel: The input mel-spectrogram for the speaker encoder. Shape: (batch_size, mel_seq_len, mel_dim).
      c_lengths: The lengths of the WavLM features. Shape: (batch_size,).
      spec_lengths: The lengths of the spectrogram. Shape: (batch_size,).
  
  Returns:
      o: The output spectrogram. Shape: (batch_size, spec_seq_len, spec_dim).
      ids_slice: The slice indices. Shape: (batch_size, num_slices).
      spec_mask: The spectrogram mask. Shape: (batch_size, spec_seq_len).
      (z, z_p, m_p, logs_p, m_q, logs_q): A tuple of latent variables.
docstr_tok: ["Forward","pass","of","the","model",".","Args",":","c",":","WavLM","features",".","Shape",":","(","batch_size",",","c_seq_len",")",".","spec",":","The","input","spectrogram",".","Shape",":","(","batch_size",",","spec_seq_len",",","spec_dim",")",".","g",":","The","speaker","embedding",".","Shape",":","(","batch_size",",","spk_emb_dim",")",".","mel",":","The","input","mel-spectrogram","for","the","speaker","encoder",".","Shape",":","(","batch_size",",","mel_seq_len",",","mel_dim",")",".","c_lengths",":","The","lengths","of","the","WavLM","features",".","Shape",":","(","batch_size",",",")",".","spec_lengths",":","The","lengths","of","the","spectrogram",".","Shape",":","(","batch_size",",",")",".","Returns",":","o",":","The","output","spectrogram",".","Shape",":","(","batch_size",",","spec_seq_len",",","spec_dim",")",".","ids_slice",":","The","slice","indices",".","Shape",":","(","batch_size",",","num_slices",")",".","spec_mask",":","The","spectrogram","mask",".","Shape",":","(","batch_size",",","spec_seq_len",")",".","(","z",",","z_p",",","m_p",",","logs_p",",","m_q",",","logs_q",")",":","A","tuple","of","latent","variables","."]
code: def forward(
      self,
      c: torch.Tensor,
      spec: torch.Tensor,
      g: Optional[torch.Tensor] = None,
      mel: Optional[torch.Tensor] = None,
      c_lengths: Optional[torch.Tensor] = None,
      spec_lengths: Optional[torch.Tensor] = None,
  ) -> Tuple[
      torch.Tensor,
      torch.Tensor,
      torch.Tensor,
      Tuple[
          torch.Tensor,
          torch.Tensor,
          torch.Tensor,
          torch.Tensor,
          torch.Tensor,
          torch.Tensor,
      ],
  ]:
      """
      Forward pass of the model.
  
      Args:
          c: WavLM features. Shape: (batch_size, c_seq_len).
          spec: The input spectrogram. Shape: (batch_size, spec_seq_len, spec_dim).
          g: The speaker embedding. Shape: (batch_size, spk_emb_dim).
          mel: The input mel-spectrogram for the speaker encoder. Shape: (batch_size, mel_seq_len, mel_dim).
          c_lengths: The lengths of the WavLM features. Shape: (batch_size,).
          spec_lengths: The lengths of the spectrogram. Shape: (batch_size,).
  
      Returns:
          o: The output spectrogram. Shape: (batch_size, spec_seq_len, spec_dim).
          ids_slice: The slice indices. Shape: (batch_size, num_slices).
          spec_mask: The spectrogram mask. Shape: (batch_size, spec_seq_len).
          (z, z_p, m_p, logs_p, m_q, logs_q): A tuple of latent variables.
      """
  
      # If c_lengths is None, set it to the length of the last dimension of c
      if c_lengths is None:
          c_lengths = (torch.ones(c.size(0)) * c.size(-1)).to(c.device)
  
      # If spec_lengths is None, set it to the length of the last dimension of spec
      if spec_lengths is None:
          spec_lengths = (torch.ones(spec.size(0)) * spec.size(-1)).to(
              spec.device
          )
  
      # If use_spk is False, compute g from mel using enc_spk
      g = None
      if not self.use_spk:
          g = self.enc_spk(mel).unsqueeze(-1)
  
      # Compute m_p, logs_p, z, m_q, logs_q, and spec_mask using enc_p and enc_q
      _, m_p, logs_p, _ = self.enc_p(c, c_lengths)
      z, m_q, logs_q, spec_mask = self.enc_q(
          spec.transpose(1, 2), spec_lengths, g=g
      )
  
      # Compute z_p using flow
      z_p = self.flow(z, spec_mask, g=g)
  
      # Randomly slice z and compute o using dec
      z_slice, ids_slice = commons.rand_slice_segments(
          z, spec_lengths, self.segment_size
      )
      o = self.dec(z_slice, g=g)
  
      return o, ids_slice, spec_mask, (z, z_p, m_p, logs_p, m_q, logs_q)
  
imports: from typing import Dict, List, Optional, Tuple, Union
  import librosa
  import numpy
  import torch
  from coqpit import Coqpit
  from torch import nn
  from torch.nn import Conv1d, Conv2d, ConvTranspose1d
  from torch.nn import functional
  from torch.nn.utils import spectral_norm
  from torch.nn.utils.parametrizations import weight_norm
  from torch.nn.utils.parametrize import remove_parametrizations
  import TTS.vc.modules.freevc.commons
  import TTS.vc.modules.freevc.modules
  from TTS.tts.utils.speakers import SpeakerManager
  from TTS.utils.io import load_fsspec
  from TTS.vc.configs.freevc_config import FreeVCConfig
  from TTS.vc.models.base_vc import BaseVC
  from TTS.vc.modules.freevc.commons import get_padding, init_weights
  from TTS.vc.modules.freevc.mel_processing import mel_spectrogram_torch
  from TTS.vc.modules.freevc.speaker_encoder.speaker_encoder import SpeakerEncoder
  from TTS.vc.modules.freevc.wavlm import get_wavlm
label_desc: Use image node_id 5 for calling the FreeVC obj's underlying member method code with example usage: obj.forward(c, spec, g, mel, c_lengths, spec_lengths) and returns: o,  ids_slice,  spec_mask,  z,  z_p,  m_p,  logs_p,  m_q,  logs_q