class_docstr: Branchformer module definition.
  
  Reference: https://arxiv.org/pdf/2207.02971.pdf
  
  Args:
      block_size: Input/output size.
      linear_size: Linear layers' hidden size.
      self_att: Self-attention module instance.
      conv_mod: Convolution module instance.
      norm_class: Normalization class.
      norm_args: Normalization module arguments.
      dropout_rate: Dropout rate.
docstr: Construct a Branchformer object.
docstr_tok: ["Construct","a","Branchformer","object","."]
code: def __init__(
      self,
      block_size: int,
      linear_size: int,
      self_att: torch.nn.Module,
      conv_mod: torch.nn.Module,
      norm_class: torch.nn.Module = torch.nn.LayerNorm,
      norm_args: Dict = {},
      dropout_rate: float = 0.0,
  ) -> None:
      """Construct a Branchformer object."""
      super().__init__()
  
      self.self_att = self_att
      self.conv_mod = conv_mod
  
      self.channel_proj1 = torch.nn.Sequential(
          torch.nn.Linear(block_size, linear_size), torch.nn.GELU()
      )
      self.channel_proj2 = torch.nn.Linear(linear_size // 2, block_size)
  
      self.merge_proj = torch.nn.Linear(
          block_size + block_size, block_size
      )
  
      self.norm_self_att = norm_class(block_size, **norm_args)
      self.norm_mlp = norm_class(block_size, **norm_args)
      self.norm_final = norm_class(block_size, **norm_args)
  
      self.dropout = torch.nn.Dropout(dropout_rate)
  
      self.block_size = block_size
      self.linear_size = linear_size
      self.cache = None
  
imports: from typing import Dict, Optional, Tuple
  import torch
label_desc: Use image node_id 1 to create a new Branchformer object from inherited base classes: torch.nn with example: obj = Branchformer(block_size, linear_size, _att, conv_mod, norm_class, norm_args, dropout_rate)