docstr: Channel Attention module.
  
  Args:
      input_dim (int): dimension of the input feature.
      att_heads (int): number of attention heads in self-attention.
      att_dim (int): projection dimension for query and key before self-attention.
      activation (str): non-linear activation function.
      eps (float): epsilon for layer normalization.
docstr_tok: ["Channel","Attention","module",".","Args",":","input_dim","(","int",")",":","dimension","of","the","input","feature",".","att_heads","(","int",")",":","number","of","attention","heads","in","self-attention",".","att_dim","(","int",")",":","projection","dimension","for","query","and","key","before","self-attention",".","activation","(","str",")",":","non-linear","activation","function",".","eps","(","float",")",":","epsilon","for","layer","normalization","."]
code: def __init__(
      self,
      input_dim,
      att_heads=4,
      att_dim=256,
      activation="relu",
      eps=1e-5,
  ):
      """Channel Attention module.
  
      Args:
          input_dim (int): dimension of the input feature.
          att_heads (int): number of attention heads in self-attention.
          att_dim (int): projection dimension for query and key before self-attention.
          activation (str): non-linear activation function.
          eps (float): epsilon for layer normalization.
      """
      super().__init__()
      self.att_heads = att_heads
      self.att_dim = att_dim
      self.activation = activation
      assert input_dim % att_heads == 0, (input_dim, att_heads)
      self.attn_conv_Q = nn.Sequential(
          nn.Linear(input_dim, att_dim),
          get_layer(activation)(),
          LayerNormalization(att_dim, dim=-1, total_dim=5, eps=eps),
      )
      self.attn_conv_K = nn.Sequential(
          nn.Linear(input_dim, att_dim),
          get_layer(activation)(),
          LayerNormalization(att_dim, dim=-1, total_dim=5, eps=eps),
      )
      self.attn_conv_V = nn.Sequential(
          nn.Linear(input_dim, input_dim),
          get_layer(activation)(),
          LayerNormalization(input_dim, dim=-1, total_dim=5, eps=eps),
      )
      self.attn_concat_proj = nn.Sequential(
          nn.Linear(input_dim, input_dim),
          get_layer(activation)(),
          LayerNormalization(input_dim, dim=-1, total_dim=5, eps=eps),
      )
  
imports: import warnings
  import torch
  import torch.nn
  from espnet2.enh.layers.dptnet import ImprovedTransformerLayer
  from espnet2.enh.layers.tcn import ChannelwiseLayerNorm
  from espnet2.torch_utils.get_layer_from_string import get_layer
label_desc: Use image node_id 1 to create a new ChannelAttention object from inherited base classes: nn with example: obj = ChannelAttention(input_dim, att_heads, att_dim, activation, eps)