class_docstr: Channel attention Module.
  
  Args:
      channels (int): The input (and output) channels of the attention layer.
      init_cfg (dict or list[dict], optional): Initialization config dict.
          Defaults to None
class_docstr_tok: ["Channel","attention","Module",".","Args",":","channels","(","int",")",":","The","input","(","and","output",")","channels","of","the","attention","layer",".","init_cfg","(","dict","or","list","[","dict","]",",","optional",")",":","Initialization","config","dict",".","Defaults","to","None"]
code: def __init__(
      self, channels: int, init_cfg: OptMultiConfig = None
  ) -> None:
      super().__init__(init_cfg=init_cfg)
      self.global_avgpool = nn.AdaptiveAvgPool2d(1)
      self.fc = nn.Conv2d(channels, channels, 1, 1, 0, bias=True)
      if digit_version(torch.__version__) < (1, 7, 0):
          self.act = nn.Hardsigmoid()
      else:
          self.act = nn.Hardsigmoid(inplace=True)
  
file_path: mmdetection/mmdet/models/layers/se_layer.py
imports: import torch
  import torch.nn
  from mmcv.cnn import ConvModule
  from mmengine.model import BaseModule
  from mmengine.utils import digit_version, is_tuple_of
  from torch import Tensor
  from mmdet.utils import MultiConfig, OptConfigType, OptMultiConfig
label_desc: Use image node_id 1 to create a new ChannelAttention object from inherited base classes: BaseModule with example: obj = ChannelAttention(channels, init_cfg)