code: def __init__(
      self, depth_wise=False, return_idx=[1, 3, 8, 13], arch=85
  ):
      super(HarDNet, self).__init__()
      assert arch in [68, 85], "HarDNet-{} is not supported.".format(
          arch
      )
      if arch == 85:
          first_ch = [48, 96]
          second_kernel = 3
          ch_list = [192, 256, 320, 480, 720]
          grmul = 1.7
          gr = [24, 24, 28, 36, 48]
          n_layers = [8, 16, 16, 16, 16]
      elif arch == 68:
          first_ch = [32, 64]
          second_kernel = 3
          ch_list = [128, 256, 320, 640]
          grmul = 1.7
          gr = [14, 16, 20, 40]
          n_layers = [8, 16, 16, 16]
      else:
          raise ValueError("HarDNet-{} is not supported.".format(arch))
  
      self.return_idx = return_idx
      self._out_channels = [96, 214, 458, 784]
  
      avg_pool = True
      if depth_wise:
          second_kernel = 1
          avg_pool = False
  
      blks = len(n_layers)
      self.base = nn.LayerList([])
  
      # First Layer: Standard Conv3x3, Stride=2
      self.base.append(
          ConvLayer(
              in_channels=3,
              out_channels=first_ch[0],
              kernel_size=3,
              stride=2,
              bias_attr=False,
          )
      )
  
      # Second Layer
      self.base.append(
          ConvLayer(first_ch[0], first_ch[1], kernel_size=second_kernel)
      )
  
      # Avgpooling or DWConv3x3 downsampling
      if avg_pool:
          self.base.append(
              nn.AvgPool2D(kernel_size=3, stride=2, padding=1)
          )
      else:
          self.base.append(
              DWConvLayer(first_ch[1], first_ch[1], stride=2)
          )
  
      # Build all HarDNet blocks
      ch = first_ch[1]
      for i in range(blks):
          blk = HarDBlock(
              ch, gr[i], grmul, n_layers[i], dwconv=depth_wise
          )
          ch = blk.out_channels
          self.base.append(blk)
  
          if i != blks - 1:
              self.base.append(ConvLayer(ch, ch_list[i], kernel_size=1))
          ch = ch_list[i]
          if i == 0:
              self.base.append(
                  nn.AvgPool2D(kernel_size=2, stride=2, ceil_mode=True)
              )
          elif i != blks - 1 and i != 1 and i != 3:
              self.base.append(nn.AvgPool2D(kernel_size=2, stride=2))
  
file_path: PaddleDetection/ppdet/modeling/backbones/hardnet.py
imports: import paddle
  import paddle.nn
  from ppdet.core.workspace import register
  from ..shape_spec import ShapeSpec
label_desc: Use image node_id 1 to create a new HarDNet object from inherited base classes: nn with example: obj = HarDNet(depth_wise, return_idx, arch)