class_docstr: Residual block module in WaveNet.
class_docstr_tok: ["Residual","block","module","in","WaveNet","."]
docstr: Initialize ResidualBlock module.
  
  Args:
      kernel_size (int): Kernel size of dilation convolution layer.
      residual_channels (int): Number of channels for residual connection.
      skip_channels (int): Number of channels for skip connection.
      aux_channels (int): Number of local conditioning channels.
      dropout (float): Dropout probability.
      dilation (int): Dilation factor.
      bias (bool): Whether to add bias parameter in convolution layers.
      scale_residual (bool): Whether to scale the residual outputs.
docstr_tok: ["Initialize","ResidualBlock","module",".","Args",":","kernel_size","(","int",")",":","Kernel","size","of","dilation","convolution","layer",".","residual_channels","(","int",")",":","Number","of","channels","for","residual","connection",".","skip_channels","(","int",")",":","Number","of","channels","for","skip","connection",".","aux_channels","(","int",")",":","Number","of","local","conditioning","channels",".","dropout","(","float",")",":","Dropout","probability",".","dilation","(","int",")",":","Dilation","factor",".","bias","(","bool",")",":","Whether","to","add","bias","parameter","in","convolution","layers",".","scale_residual","(","bool",")",":","Whether","to","scale","the","residual","outputs","."]
code: def __init__(
      self,
      kernel_size: int = 3,
      residual_channels: int = 64,
      gate_channels: int = 128,
      skip_channels: int = 64,
      aux_channels: int = 80,
      global_channels: int = -1,
      dropout_rate: float = 0.0,
      dilation: int = 1,
      bias: bool = True,
      scale_residual: bool = False,
  ):
      """Initialize ResidualBlock module.
  
      Args:
          kernel_size (int): Kernel size of dilation convolution layer.
          residual_channels (int): Number of channels for residual connection.
          skip_channels (int): Number of channels for skip connection.
          aux_channels (int): Number of local conditioning channels.
          dropout (float): Dropout probability.
          dilation (int): Dilation factor.
          bias (bool): Whether to add bias parameter in convolution layers.
          scale_residual (bool): Whether to scale the residual outputs.
  
      """
      super().__init__()
      self.dropout_rate = dropout_rate
      self.residual_channels = residual_channels
      self.skip_channels = skip_channels
      self.scale_residual = scale_residual
  
      # check
      assert (
          kernel_size - 1
      ) % 2 == 0, "Not support even number kernel size."
      assert gate_channels % 2 == 0
  
      # dilation conv
      padding = (kernel_size - 1) // 2 * dilation
      self.conv = Conv1d(
          residual_channels,
          gate_channels,
          kernel_size,
          padding=padding,
          dilation=dilation,
          bias=bias,
      )
  
      # local conditioning
      if aux_channels > 0:
          self.conv1x1_aux = Conv1d1x1(
              aux_channels, gate_channels, bias=False
          )
      else:
          self.conv1x1_aux = None
  
      # global conditioning
      if global_channels > 0:
          self.conv1x1_glo = Conv1d1x1(
              global_channels, gate_channels, bias=False
          )
      else:
          self.conv1x1_glo = None
  
      # conv output is split into two groups
      gate_out_channels = gate_channels // 2
  
      # NOTE(kan-bayashi): concat two convs into a single conv for the efficiency
      #   (integrate res 1x1 + skip 1x1 convs)
      self.conv1x1_out = Conv1d1x1(
          gate_out_channels,
          residual_channels + skip_channels,
          bias=bias,
      )
  
file_path: espnet/espnet2/gan_tts/wavenet/residual_block.py
imports: import math
  from typing import Optional, Tuple
  import torch
  import torch.nn.functional
label_desc: Use image node_id 1 to create a new ResidualBlock object from inherited base classes: torch.nn with example: obj = ResidualBlock(kernel_size, residual_channels, gate_channels, skip_channels, aux_channels, global_channels, dropout_rate, dilation, bias, scale_residual)