class_docstr: TADEResBlock module.
docstr: Initialize TADEResBlock module.
  
  Args:
      in_channels (int): Number of input channles.
      aux_channels (int): Number of auxirialy channles.
      kernel_size (int): Kernel size.
      bias (bool): Whether to use bias parameter in conv.
      upsample_factor (int): Upsample factor.
      upsample_mode (str): Upsample mode.
      gated_function (str): Gated function type (softmax of sigmoid).
docstr_tok: ["Initialize","TADEResBlock","module",".","Args",":","in_channels","(","int",")",":","Number","of","input","channles",".","aux_channels","(","int",")",":","Number","of","auxirialy","channles",".","kernel_size","(","int",")",":","Kernel","size",".","bias","(","bool",")",":","Whether","to","use","bias","parameter","in","conv",".","upsample_factor","(","int",")",":","Upsample","factor",".","upsample_mode","(","str",")",":","Upsample","mode",".","gated_function","(","str",")",":","Gated","function","type","(","softmax","of","sigmoid",")","."]
code: def __init__(
      self,
      in_channels: int = 64,
      aux_channels: int = 80,
      kernel_size: int = 9,
      dilation: int = 2,
      bias: bool = True,
      upsample_factor: int = 2,
      upsample_mode: str = "nearest",
      gated_function: str = "softmax",
  ):
      """Initialize TADEResBlock module.
  
      Args:
          in_channels (int): Number of input channles.
          aux_channels (int): Number of auxirialy channles.
          kernel_size (int): Kernel size.
          bias (bool): Whether to use bias parameter in conv.
          upsample_factor (int): Upsample factor.
          upsample_mode (str): Upsample mode.
          gated_function (str): Gated function type (softmax of sigmoid).
  
      """
      super().__init__()
      self.tade1 = TADELayer(
          in_channels=in_channels,
          aux_channels=aux_channels,
          kernel_size=kernel_size,
          bias=bias,
          # NOTE(kan-bayashi): Use upsample in the first TADE layer?
          upsample_factor=1,
          upsample_mode=upsample_mode,
      )
      self.gated_conv1 = torch.nn.Conv1d(
          in_channels,
          in_channels * 2,
          kernel_size,
          1,
          bias=bias,
          padding=(kernel_size - 1) // 2,
      )
      self.tade2 = TADELayer(
          in_channels=in_channels,
          aux_channels=in_channels,
          kernel_size=kernel_size,
          bias=bias,
          upsample_factor=upsample_factor,
          upsample_mode=upsample_mode,
      )
      self.gated_conv2 = torch.nn.Conv1d(
          in_channels,
          in_channels * 2,
          kernel_size,
          1,
          bias=bias,
          dilation=dilation,
          padding=(kernel_size - 1) // 2 * dilation,
      )
      self.upsample = torch.nn.Upsample(
          scale_factor=upsample_factor, mode=upsample_mode
      )
      if gated_function == "softmax":
          self.gated_function = partial(torch.softmax, dim=1)
      elif gated_function == "sigmoid":
          self.gated_function = torch.sigmoid
      else:
          raise ValueError(f"{gated_function} is not supported.")
  
file_path: espnet/espnet2/gan_tts/style_melgan/tade_res_block.py
imports: from functools import partial
  import torch
label_desc: Use image node_id 1 to create a new TADEResBlock object from inherited base classes: torch.nn with example: obj = TADEResBlock(in_channels, aux_channels, kernel_size, dilation, bias, upsample_factor, upsample_mode, gated_function)