class_docstr: Conformer layer that constitutes Conformer.
  
  Args:
      input_dim (int): input dimension.
      ffn_dim (int): hidden layer dimension of feedforward network.
      num_attention_heads (int): number of attention heads.
      depthwise_conv_kernel_size (int): kernel size of depthwise convolution layer.
      dropout (float, optional): dropout probability. (Default: 0.0)
      use_group_norm (bool, optional): use ``GroupNorm`` rather than ``BatchNorm1d``
          in the convolution module. (Default: ``False``)
      convolution_first (bool, optional): apply the convolution module ahead of
          the attention module. (Default: ``False``)
class_docstr_tok: ["Conformer","layer","that","constitutes","Conformer",".","Args",":","input_dim","(","int",")",":","input","dimension",".","ffn_dim","(","int",")",":","hidden","layer","dimension","of","feedforward","network",".","num_attention_heads","(","int",")",":","number","of","attention","heads",".","depthwise_conv_kernel_size","(","int",")",":","kernel","size","of","depthwise","convolution","layer",".","dropout","(","float",",","optional",")",":","dropout","probability",".","(","Default",":","0.0",")","use_group_norm","(","bool",",","optional",")",":","use","``","GroupNorm","``","rather","than","``","BatchNorm1d","``","in","the","convolution","module",".","(","Default",":","``","False","``",")","convolution_first","(","bool",",","optional",")",":","apply","the","convolution","module","ahead","of","the","attention","module",".","(","Default",":","``","False","``",")"]
code: def __init__(
      self,
      input_dim: int,
      ffn_dim: int,
      num_attention_heads: int,
      depthwise_conv_kernel_size: int,
      dropout: float = 0.0,
      use_group_norm: bool = False,
      convolution_first: bool = False,
  ) -> None:
      super().__init__()
  
      self.ffn1 = _FeedForwardModule(
          input_dim, ffn_dim, dropout=dropout
      )
  
      self.self_attn_layer_norm = torch.nn.LayerNorm(input_dim)
      self.self_attn = torch.nn.MultiheadAttention(
          input_dim, num_attention_heads, dropout=dropout
      )
      self.self_attn_dropout = torch.nn.Dropout(dropout)
  
      self.conv_module = _ConvolutionModule(
          input_dim=input_dim,
          num_channels=input_dim,
          depthwise_kernel_size=depthwise_conv_kernel_size,
          dropout=dropout,
          bias=True,
          use_group_norm=use_group_norm,
      )
  
      self.ffn2 = _FeedForwardModule(
          input_dim, ffn_dim, dropout=dropout
      )
      self.final_layer_norm = torch.nn.LayerNorm(input_dim)
      self.convolution_first = convolution_first
  
imports: from typing import Optional, Tuple
  import torch
label_desc: Use image node_id 1 to create a new ConformerLayer object from inherited base classes: torch.nn with example: obj = ConformerLayer(input_dim, ffn_dim, num_attention_heads, depthwise_conv_kernel_size, dropout, use_group_norm, convolution_first)