class_docstr: This is an implementation of the convolution branch in Branchformer.
  
  The default structure is:
  LN -> Channel Proj -> GeLU -> (CNN Spatial Gating) -> Channel Proj -> Dropout
  
  Arguments
  ----------
  input_size : int
      The expected size of the feature (channel) dimension.
  linear_units: int, optional
      Number of neurons in the hidden linear units.
  kernel_size: int, optional
      Kernel size of non-bottleneck convolutional layer.
  activation: torch.nn.Module, optional
       Activation function used after pre projection.
  gate_activation: torch.nn.Module, optional
       Activation function used at the gate of the CSGU module.
  dropout: float, optional
       Dropout rate.
  use_linear_after_conv: bool, optional
      If True, will apply a linear transformation of size input_size//2
  
  Example
  -------
  >>> x = torch.rand((8, 60, 512))
  >>> net = ConvolutionBranch(512, 1024)
  >>> output = net(x)
  >>> output.shape
  torch.Size([8, 60, 512])
class_docstr_tok: ["This","is","an","implementation","of","the","convolution","branch","in","Branchformer",".","The","default","structure","is",":","LN","-",">","Channel","Proj","-",">","GeLU","-",">","(","CNN","Spatial","Gating",")","-",">","Channel","Proj","-",">","Dropout","Arguments","--","--","--","--","--","input_size",":","int","The","expected","size","of","the","feature","(","channel",")","dimension",".","linear_units",":","int",",","optional","Number","of","neurons","in","the","hidden","linear","units",".","kernel_size",":","int",",","optional","Kernel","size","of","non-bottleneck","convolutional","layer",".","activation",":","torch.nn.Module",",","optional","Activation","function","used","after","pre","projection",".","gate_activation",":","torch.nn.Module",",","optional","Activation","function","used","at","the","gate","of","the","CSGU","module",".","dropout",":","float",",","optional","Dropout","rate",".","use_linear_after_conv",":","bool",",","optional","If","True",",","will","apply","a","linear","transformation","of","size","input_size\/\/2","Example","--","--","--","-",">",">",">","x","=","torch.rand","(","(","8",",","60",",","512",")",")",">",">",">","net","=","ConvolutionBranch","(","512",",","1024",")",">",">",">","output","=","net","(","x",")",">",">",">","output.shape","torch.Size","(","[","8",",","60",",","512","]",")"]
docstr: Arguments
  ----------
  x: torch.Tensor -> (B, T, D)
docstr_tok: ["Arguments","--","--","--","--","--","x",":","torch.Tensor","-",">","(","B",",","T",",","D",")"]
code: def forward(self, x):
      """
      Arguments
      ----------
      x: torch.Tensor -> (B, T, D)
  
      """
      x = self.activation(self.pre_channel_proj(x))  # (B, T, D)
      x = self.csgu(x)  # (B, T, D//2)
      x = self.post_channel_proj(x)  # (B, T, D)
  
      return x
  
file_path: speechbrain/speechbrain/lobes/models/transformer/Branchformer.py
imports: import torch
  import torch.nn
  from typing import Optional
  from speechbrain.nnet.attention import RelPosMHAXL, MultiheadAttention
  from speechbrain.nnet.normalization import LayerNorm
  from speechbrain.lobes.models.convolution import ConvolutionalSpatialGatingUnit
  from speechbrain.lobes.models.transformer.hypermixing import HyperMixing
label_desc: Use image node_id 2 for calling the ConvolutionBranch obj's underlying member method code with example usage: obj.forward(x) and returns: x