class_docstr: Variance predictor module.
  
  This is a module of variacne predictor described in `FastSpeech 2:
  Fast and High-Quality End-to-End Text to Speech`_.
  
  .. _`FastSpeech 2: Fast and High-Quality End-to-End Text to Speech`:
      https://arxiv.org/abs/2006.04558
docstr: Initilize duration predictor module.
  
  Args:
      idim (int): Input dimension.
      n_layers (int): Number of convolutional layers.
      n_chans (int): Number of channels of convolutional layers.
      kernel_size (int): Kernel size of convolutional layers.
      dropout_rate (float): Dropout rate.
docstr_tok: ["Initilize","duration","predictor","module",".","Args",":","idim","(","int",")",":","Input","dimension",".","n_layers","(","int",")",":","Number","of","convolutional","layers",".","n_chans","(","int",")",":","Number","of","channels","of","convolutional","layers",".","kernel_size","(","int",")",":","Kernel","size","of","convolutional","layers",".","dropout_rate","(","float",")",":","Dropout","rate","."]
code: def __init__(
      self,
      idim: int,
      n_layers: int = 2,
      n_chans: int = 384,
      kernel_size: int = 3,
      bias: bool = True,
      dropout_rate: float = 0.5,
  ):
      """Initilize duration predictor module.
  
      Args:
          idim (int): Input dimension.
          n_layers (int): Number of convolutional layers.
          n_chans (int): Number of channels of convolutional layers.
          kernel_size (int): Kernel size of convolutional layers.
          dropout_rate (float): Dropout rate.
  
      """
      assert check_argument_types()
      super().__init__()
      self.conv = torch.nn.ModuleList()
      for idx in range(n_layers):
          in_chans = idim if idx == 0 else n_chans
          self.conv += [
              torch.nn.Sequential(
                  torch.nn.Conv1d(
                      in_chans,
                      n_chans,
                      kernel_size,
                      stride=1,
                      padding=(kernel_size - 1) // 2,
                      bias=bias,
                  ),
                  torch.nn.ReLU(),
                  LayerNorm(n_chans, dim=1),
                  torch.nn.Dropout(dropout_rate),
              )
          ]
      self.linear = torch.nn.Linear(n_chans, 1)
  
imports: import torch
  from typeguard import check_argument_types
  from espnet.nets.pytorch_backend.transformer.layer_norm import LayerNorm
label_desc: Use image node_id 1 to create a new VariancePredictor object from inherited base classes: torch.nn with example: obj = VariancePredictor(idim, n_layers, n_chans, kernel_size, bias, dropout_rate)