code: def __init__(
      self,
      in_channels,
      mid_channels,
      out_channels,
      block_num,
      layer_num,
      downsample=True,
      stride=[2, 1],
  ):
      super().__init__()
      self.downsample = downsample
      if downsample:
          self.downsample = ConvBNAct(
              in_channels=in_channels,
              out_channels=in_channels,
              kernel_size=3,
              stride=stride,
              groups=in_channels,
              use_act=False,
          )
  
      blocks_list = []
      blocks_list.append(
          HG_Block(
              in_channels,
              mid_channels,
              out_channels,
              layer_num,
              identity=False,
          )
      )
      for _ in range(block_num - 1):
          blocks_list.append(
              HG_Block(
                  out_channels,
                  mid_channels,
                  out_channels,
                  layer_num,
                  identity=True,
              )
          )
      self.blocks = nn.Sequential(*blocks_list)
  
imports: import paddle
  import paddle.nn
  import paddle.nn.functional
  from paddle.nn.initializer import KaimingNormal, Constant
  from paddle.nn import Conv2D, BatchNorm2D, ReLU, AdaptiveAvgPool2D, MaxPool2D
  from paddle.regularizer import L2Decay
  from paddle import ParamAttr
label_desc: Use image node_id 1 to create a new HG_Stage object from inherited base classes: nn with example: obj = HG_Stage(in_channels, mid_channels, out_channels, block_num, layer_num, downsample, stride)