code: def __init__(self, in_channels):
      super(ChannelAttention, self).__init__()
      self.global_pools = nn.ModuleList(
          [
              nn.AdaptiveAvgPool2d(1),
              nn.AdaptiveMaxPool2d(1),
          ]
      )
      intermediate_channels_count = max(in_channels // 16, 8)
      self.attention_transform = nn.Sequential(
          nn.Linear(
              len(self.global_pools) * in_channels,
              intermediate_channels_count,
          ),
          nn.ReLU(),
          nn.Linear(intermediate_channels_count, in_channels),
          nn.Sigmoid(),
      )
  
imports: import torch
  import torch.nn
label_desc: Use image node_id 1 to create a new ChannelAttention object from inherited base classes: nn with example: obj = ChannelAttention(in_channels)