docstr: Convolution module for conformer. Starts with a gating machanism.
  a pointwise convolution and a gated linear unit (GLU). This is followed
  by a single 1-D depthwise convolution layer. Batchnorm is deployed just after the convolution
  to help with training. it also contains an expansion factor to project the number of channels.
  
  Args:
      d_model (int): The dimension of model.
      expansion_factor (int): The factor by which to project the number of channels.
      kernel_size (int): Size of kernels for convolution modules.
      dropout (float): Probabilty of dropout.
      lrelu_slope (float): The slope coefficient for leaky relu activation.
  
  Inputs: inputs
      - **inputs** (batch, time, dim): Tensor containing input vector
  Returns:
      - **outputs** (batch, time, dim): Tensor produced by the conv module.
docstr_tok: ["Convolution","module","for","conformer",".","Starts","with","a","gating","machanism",".","a","pointwise","convolution","and","a","gated","linear","unit","(","GLU",")",".","This","is","followed","by","a","single","1-D","depthwise","convolution","layer",".","Batchnorm","is","deployed","just","after","the","convolution","to","help","with","training",".","it","also","contains","an","expansion","factor","to","project","the","number","of","channels",".","Args",":","d_model","(","int",")",":","The","dimension","of","model",".","expansion_factor","(","int",")",":","The","factor","by","which","to","project","the","number","of","channels",".","kernel_size","(","int",")",":","Size","of","kernels","for","convolution","modules",".","dropout","(","float",")",":","Probabilty","of","dropout",".","lrelu_slope","(","float",")",":","The","slope","coefficient","for","leaky","relu","activation",".","Inputs",":","inputs","-","*","*","inputs","*","*","(","batch",",","time",",","dim",")",":","Tensor","containing","input","vector","Returns",":","-","*","*","outputs","*","*","(","batch",",","time",",","dim",")",":","Tensor","produced","by","the","conv","module","."]
code: def __init__(
      self,
      d_model: int,
      expansion_factor: int = 2,
      kernel_size: int = 7,
      dropout: float = 0.1,
      lrelu_slope: float = 0.3,
  ):
      """
      Convolution module for conformer. Starts with a gating machanism.
      a pointwise convolution and a gated linear unit (GLU). This is followed
      by a single 1-D depthwise convolution layer. Batchnorm is deployed just after the convolution
      to help with training. it also contains an expansion factor to project the number of channels.
  
      Args:
          d_model (int): The dimension of model.
          expansion_factor (int): The factor by which to project the number of channels.
          kernel_size (int): Size of kernels for convolution modules.
          dropout (float): Probabilty of dropout.
          lrelu_slope (float): The slope coefficient for leaky relu activation.
  
      Inputs: inputs
          - **inputs** (batch, time, dim): Tensor containing input vector
      Returns:
          - **outputs** (batch, time, dim): Tensor produced by the conv module.
  
      """
      super().__init__()
      inner_dim = d_model * expansion_factor
      self.ln_1 = nn.LayerNorm(d_model)
      self.conv_1 = PointwiseConv1d(d_model, inner_dim * 2)
      self.conv_act = GLUActivation(slope=lrelu_slope)
      self.depthwise = DepthWiseConv1d(
          inner_dim,
          inner_dim,
          kernel_size=kernel_size,
          padding=calc_same_padding(kernel_size)[0],
      )
      self.ln_2 = nn.GroupNorm(1, inner_dim)
      self.activation = nn.LeakyReLU(lrelu_slope)
      self.conv_2 = PointwiseConv1d(inner_dim, d_model)
      self.dropout = nn.Dropout(dropout)
  
imports: import math
  from typing import Tuple
  import torch
  import torch.nn
  import torch.nn.functional
  from TTS.tts.layers.delightful_tts.conv_layers import Conv1dGLU, DepthWiseConv1d, PointwiseConv1d
  from TTS.tts.layers.delightful_tts.networks import GLUActivation
label_desc: Use image node_id 1 to create a new ConformerConvModule object from inherited base classes: nn with example: obj = ConformerConvModule(d_model, expansion_factor, kernel_size, dropout, lrelu_slope)