class_docstr: Residual affine coupling layer.
docstr: Initialzie ResidualAffineCouplingLayer module.
  
  Args:
      in_channels (int): Number of input channels.
      hidden_channels (int): Number of hidden channels.
      kernel_size (int): Kernel size for WaveNet.
      base_dilation (int): Base dilation factor for WaveNet.
      layers (int): Number of layers of WaveNet.
      stacks (int): Number of stacks of WaveNet.
      global_channels (int): Number of global channels.
      dropout_rate (float): Dropout rate.
      use_weight_norm (bool): Whether to use weight normalization in WaveNet.
      bias (bool): Whether to use bias paramters in WaveNet.
      use_only_mean (bool): Whether to estimate only mean.
code: def __init__(
      self,
      in_channels: int = 192,
      hidden_channels: int = 192,
      kernel_size: int = 5,
      base_dilation: int = 1,
      layers: int = 5,
      stacks: int = 1,
      global_channels: int = -1,
      dropout_rate: float = 0.0,
      use_weight_norm: bool = True,
      bias: bool = True,
      use_only_mean: bool = True,
  ):
      """Initialzie ResidualAffineCouplingLayer module.
  
      Args:
          in_channels (int): Number of input channels.
          hidden_channels (int): Number of hidden channels.
          kernel_size (int): Kernel size for WaveNet.
          base_dilation (int): Base dilation factor for WaveNet.
          layers (int): Number of layers of WaveNet.
          stacks (int): Number of stacks of WaveNet.
          global_channels (int): Number of global channels.
          dropout_rate (float): Dropout rate.
          use_weight_norm (bool): Whether to use weight normalization in WaveNet.
          bias (bool): Whether to use bias paramters in WaveNet.
          use_only_mean (bool): Whether to estimate only mean.
  
      """
      assert (
          in_channels % 2 == 0
      ), "in_channels should be divisible by 2"
      super().__init__()
      self.half_channels = in_channels // 2
      self.use_only_mean = use_only_mean
  
      # define modules
      self.input_conv = torch.nn.Conv1d(
          self.half_channels,
          hidden_channels,
          1,
      )
      self.encoder = WaveNet(
          in_channels=-1,
          out_channels=-1,
          kernel_size=kernel_size,
          layers=layers,
          stacks=stacks,
          base_dilation=base_dilation,
          residual_channels=hidden_channels,
          aux_channels=-1,
          gate_channels=hidden_channels * 2,
          skip_channels=hidden_channels,
          global_channels=global_channels,
          dropout_rate=dropout_rate,
          bias=bias,
          use_weight_norm=use_weight_norm,
          use_first_conv=False,
          use_last_conv=False,
          scale_residual=False,
          scale_skip_connect=True,
      )
      if use_only_mean:
          self.proj = torch.nn.Conv1d(
              hidden_channels,
              self.half_channels,
              1,
          )
      else:
          self.proj = torch.nn.Conv1d(
              hidden_channels,
              self.half_channels * 2,
              1,
          )
      self.proj.weight.data.zero_()
      self.proj.bias.data.zero_()
  
file_path: espnet/espnet2/gan_tts/vits/residual_coupling.py
imports: from typing import Optional, Tuple, Union
  import torch
  from espnet2.gan_tts.vits.flow import FlipFlow
  from espnet2.gan_tts.wavenet import WaveNet
label_desc: Use image node_id 1 to create a new ResidualAffineCouplingLayer object from inherited base classes: torch.nn with example: obj = ResidualAffineCouplingLayer(in_channels, hidden_channels, kernel_size, base_dilation, layers, stacks, global_channels, dropout_rate, use_weight_norm, bias, use_only_mean)