code: def __init__(
      self, in_channels: int, config: StageConfig, identity: bool
  ) -> None:
      super().__init__()
      self.identity = identity
  
      layer_cls = (
          LightConvNormAct if config.light_block else ConvNormAct
      )
      self.layers = nn.ModuleList()
      for i in range(config.layer_num):
          ch_in = in_channels if i == 0 else config.mid_channels
          self.layers.append(
              layer_cls(ch_in, config.mid_channels, config.kernel_size)
          )
  
      total_channels = (
          in_channels + config.mid_channels * config.layer_num
      )
      self.aggregation_squeeze_conv = ConvNormAct(
          total_channels, config.out_channels // 2, 1
      )
      self.aggregation_excitation_conv = ConvNormAct(
          config.out_channels // 2, config.out_channels, 1
      )
  
imports: from __future__ import annotations
  from typing import NamedTuple
  from torch import nn
  from kornia.contrib.models.common import ConvNormAct
  from kornia.core import Module, Tensor, concatenate
  from kornia.core.check import KORNIA_CHECK
label_desc: Use image node_id 1 to create a new HGBlock object from inherited base classes: Module with example: obj = HGBlock(in_channels, config, identity)