class_docstr: ConformerConvolution module definition.
  
  Args:
      channels: The number of channels.
      kernel_size: Size of the convolving kernel.
      activation: Activation function.
      norm_args: Normalization module arguments.
      causal: Whether to use causal convolution (set to True if streaming).
class_docstr_tok: ["ConformerConvolution","module","definition",".","Args",":","channels",":","The","number","of","channels",".","kernel_size",":","Size","of","the","convolving","kernel",".","activation",":","Activation","function",".","norm_args",":","Normalization","module","arguments",".","causal",":","Whether","to","use","causal","convolution","(","set","to","True","if","streaming",")","."]
docstr: Construct an ConformerConvolution object.
docstr_tok: ["Construct","an","ConformerConvolution","object","."]
code: def __init__(
      self,
      channels: int,
      kernel_size: int,
      activation: torch.nn.Module = torch.nn.ReLU(),
      norm_args: Dict = {},
      causal: bool = False,
  ) -> None:
      """Construct an ConformerConvolution object."""
      super().__init__()
  
      assert (kernel_size - 1) % 2 == 0
  
      self.kernel_size = kernel_size
  
      self.pointwise_conv1 = torch.nn.Conv1d(
          channels,
          2 * channels,
          kernel_size=1,
          stride=1,
          padding=0,
      )
  
      if causal:
          self.lorder = kernel_size - 1
          padding = 0
      else:
          self.lorder = 0
          padding = (kernel_size - 1) // 2
  
      self.depthwise_conv = torch.nn.Conv1d(
          channels,
          channels,
          kernel_size,
          stride=1,
          padding=padding,
          groups=channels,
      )
      self.norm = torch.nn.BatchNorm1d(channels, **norm_args)
      self.pointwise_conv2 = torch.nn.Conv1d(
          channels,
          channels,
          kernel_size=1,
          stride=1,
          padding=0,
      )
  
      self.activation = activation
  
file_path: espnet/espnet2/asr_transducer/encoder/modules/convolution.py
imports: from typing import Dict, Optional, Tuple
  import torch
label_desc: Use image node_id 1 to create a new ConformerConvolution object from inherited base classes: torch.nn with example: obj = ConformerConvolution(channels, kernel_size, activation, norm_args, causal)