docstr: Posterior Encoder of VITS model.
  
  ::
      x -> conv1x1() -> WaveNet() (non-causal) -> conv1x1() -> split() -> [m, s] -> sample(m, s) -> z
  
  Args:
      in_channels (int): Number of input tensor channels.
      out_channels (int): Number of output tensor channels.
      hidden_channels (int): Number of hidden channels.
      kernel_size (int): Kernel size of the WaveNet convolution layers.
      dilation_rate (int): Dilation rate of the WaveNet layers.
      num_layers (int): Number of the WaveNet layers.
      cond_channels (int, optional): Number of conditioning tensor channels. Defaults to 0.
docstr_tok: ["Posterior","Encoder","of","VITS","model",".",":",":","x","-",">","conv1x1","(",")","-",">","WaveNet","(",")","(","non-causal",")","-",">","conv1x1","(",")","-",">","split","(",")","-",">","[","m",",","s","]","-",">","sample","(","m",",","s",")","-",">","z","Args",":","in_channels","(","int",")",":","Number","of","input","tensor","channels",".","out_channels","(","int",")",":","Number","of","output","tensor","channels",".","hidden_channels","(","int",")",":","Number","of","hidden","channels",".","kernel_size","(","int",")",":","Kernel","size","of","the","WaveNet","convolution","layers",".","dilation_rate","(","int",")",":","Dilation","rate","of","the","WaveNet","layers",".","num_layers","(","int",")",":","Number","of","the","WaveNet","layers",".","cond_channels","(","int",",","optional",")",":","Number","of","conditioning","tensor","channels",".","Defaults","to","0","."]
code: def __init__(
      self,
      in_channels: int,
      out_channels: int,
      hidden_channels: int,
      kernel_size: int,
      dilation_rate: int,
      num_layers: int,
      cond_channels=0,
  ):
      """Posterior Encoder of VITS model.
  
      ::
          x -> conv1x1() -> WaveNet() (non-causal) -> conv1x1() -> split() -> [m, s] -> sample(m, s) -> z
  
      Args:
          in_channels (int): Number of input tensor channels.
          out_channels (int): Number of output tensor channels.
          hidden_channels (int): Number of hidden channels.
          kernel_size (int): Kernel size of the WaveNet convolution layers.
          dilation_rate (int): Dilation rate of the WaveNet layers.
          num_layers (int): Number of the WaveNet layers.
          cond_channels (int, optional): Number of conditioning tensor channels. Defaults to 0.
      """
      super().__init__()
      self.in_channels = in_channels
      self.out_channels = out_channels
      self.hidden_channels = hidden_channels
      self.kernel_size = kernel_size
      self.dilation_rate = dilation_rate
      self.num_layers = num_layers
      self.cond_channels = cond_channels
  
      self.pre = nn.Conv1d(in_channels, hidden_channels, 1)
      self.enc = WN(
          hidden_channels,
          hidden_channels,
          kernel_size,
          dilation_rate,
          num_layers,
          c_in_channels=cond_channels,
      )
      self.proj = nn.Conv1d(hidden_channels, out_channels * 2, 1)
  
imports: import math
  import torch
  from torch import nn
  from TTS.tts.layers.glow_tts.glow import WN
  from TTS.tts.layers.glow_tts.transformer import RelativePositionTransformer
  from TTS.tts.utils.helpers import sequence_mask
label_desc: Use image node_id 1 to create a new PosteriorEncoder object from inherited base classes: nn with example: obj = PosteriorEncoder(in_channels, out_channels, hidden_channels, kernel_size, dilation_rate, num_layers, cond_channels)