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 forward(self, body_feats):
      num_backbone_stages = len(body_feats)
  
      outs = []
      outs.append(body_feats[0])
  
      # resize
      for i in range(1, num_backbone_stages):
          resized = F.interpolate(
              body_feats[i], scale_factor=2**i, mode="bilinear"
          )
          outs.append(resized)
  
      # concat
      out = paddle.concat(outs, axis=1)
      assert (
          out.shape[1] == self.in_channel
      ), "in_channel should be {}, be received {}".format(
          out.shape[1], self.in_channel
      )
  
      # reduction
      out = self.reduction(out)
  
      # conv
      outs = [out]
      for i in range(1, self.num_out):
          outs.append(
              F.avg_pool2d(out, kernel_size=2**i, stride=2**i)
          )
      outputs = []
  
      for i in range(self.num_out):
          conv_func = (
              self.fpn_conv if self.share_conv else self.fpn_conv[i]
          )
          conv = conv_func(outs[i])
          outputs.append(conv)
  
      fpn_feats = [outputs[k] for k in range(self.num_out)]
      return fpn_feats
  
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 2 for calling the HRFPN obj's underlying member method code with example usage: obj.forward(body_feats) and returns: fpn_feats