class_docstr: Convolutional Spatial Gating Unit (CSGU).
code: def __init__(
      self,
      size: int,
      kernel_size: int,
      dropout_rate: float,
      use_linear_after_conv: bool,
      gate_activation: str,
  ):
      super().__init__()
  
      n_channels = size // 2  # split input channels
      self.norm = LayerNorm(n_channels)
      self.conv = torch.nn.Conv1d(
          n_channels,
          n_channels,
          kernel_size,
          1,
          (kernel_size - 1) // 2,
          groups=n_channels,
      )
      if use_linear_after_conv:
          self.linear = torch.nn.Linear(n_channels, n_channels)
      else:
          self.linear = None
  
      if gate_activation == "identity":
          self.act = torch.nn.Identity()
      else:
          self.act = get_activation(gate_activation)
  
      self.dropout = torch.nn.Dropout(dropout_rate)
  
file_path: espnet/espnet2/asr/layers/cgmlp.py
imports: import torch
  from espnet.nets.pytorch_backend.nets_utils import get_activation
  from espnet.nets.pytorch_backend.transformer.layer_norm import LayerNorm
label_desc: Use image node_id 1 to create a new ConvolutionalSpatialGatingUnit object from inherited base classes: torch.nn with example: obj = ConvolutionalSpatialGatingUnit(size, kernel_size, dropout_rate, use_linear_after_conv, gate_activation)