class_docstr: Args:
      in_channels (list): number of input feature channels from backbone
      out_channel (int): number of output feature channels
      share_conv (bool): whether to share conv for different layers' reduction
      extra_stage (int): add extra stage for returning HRFPN fpn_feats
      spatial_scales (list): feature map scaling factor
class_docstr_tok: ["Args",":","in_channels","(","list",")",":","number","of","input","feature","channels","from","backbone","out_channel","(","int",")",":","number","of","output","feature","channels","share_conv","(","bool",")",":","whether","to","share","conv","for","different","layers","'","reduction","extra_stage","(","int",")",":","add","extra","stage","for","returning","HRFPN","fpn_feats","spatial_scales","(","list",")",":","feature","map","scaling","factor"]
code: def __init__(
      self,
      in_channels=[18, 36, 72, 144],
      out_channel=256,
      share_conv=False,
      extra_stage=1,
      spatial_scales=[1.0 / 4, 1.0 / 8, 1.0 / 16, 1.0 / 32],
      use_bias=False,
  ):
      super(HRFPN, self).__init__()
      in_channel = sum(in_channels)
      self.in_channel = in_channel
      self.out_channel = out_channel
      self.share_conv = share_conv
      for i in range(extra_stage):
          spatial_scales = spatial_scales + [spatial_scales[-1] / 2.0]
      self.spatial_scales = spatial_scales
      self.num_out = len(self.spatial_scales)
      self.use_bias = use_bias
      bias_attr = False if use_bias is False else None
  
      self.reduction = nn.Conv2D(
          in_channels=in_channel,
          out_channels=out_channel,
          kernel_size=1,
          bias_attr=bias_attr,
      )
  
      if share_conv:
          self.fpn_conv = nn.Conv2D(
              in_channels=out_channel,
              out_channels=out_channel,
              kernel_size=3,
              padding=1,
              bias_attr=bias_attr,
          )
      else:
          self.fpn_conv = []
          for i in range(self.num_out):
              conv_name = "fpn_conv_" + str(i)
              conv = self.add_sublayer(
                  conv_name,
                  nn.Conv2D(
                      in_channels=out_channel,
                      out_channels=out_channel,
                      kernel_size=3,
                      padding=1,
                      bias_attr=bias_attr,
                  ),
              )
              self.fpn_conv.append(conv)
  
file_path: PaddleDetection/ppdet/modeling/necks/hrfpn.py
imports: import paddle
  import paddle.nn.functional
  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 HRFPN object from inherited base classes: nn with example: obj = HRFPN(in_channels, out_channel, share_conv, extra_stage, spatial_scales, use_bias)