class_docstr: Bidirectional Feature Pyramid Network, see https://arxiv.org/abs/1911.09070
  
  Args:
      in_channels (list[int]): input channels of each level which can be
          derived from the output shape of backbone by from_config.
      out_channel (int): output channel of each level.
      num_extra_levels (int): the number of extra stages added to the last level.
          default: 2
      fpn_strides (List): The stride of each level.
      num_stacks (int): the number of stacks for BiFPN, default: 1.
      use_weighted_fusion (bool): use weighted feature fusion in BiFPN, default: True.
      norm_type (string|None): the normalization type in BiFPN module. If
          norm_type is None, norm will not be used after conv and if
          norm_type is string, bn, gn, sync_bn are available. default: bn.
      norm_groups (int): if you use gn, set this param.
      act (string|None): the activation function of BiFPN.
code: def __init__(
      self,
      in_channels=(512, 1024, 2048),
      out_channel=256,
      num_extra_levels=2,
      fpn_strides=[8, 16, 32, 64, 128],
      num_stacks=1,
      use_weighted_fusion=True,
      norm_type="bn",
      norm_groups=32,
      act="swish",
  ):
      super(BiFPN, self).__init__()
      assert (
          num_stacks > 0
      ), "The number of stacks of BiFPN is at least 1."
      assert norm_type in ["bn", "sync_bn", "gn", None]
      assert act in ["swish", "relu", None]
      assert (
          num_extra_levels >= 0
      ), "The `num_extra_levels` must be non negative(>=0)."
  
      self.in_channels = in_channels
      self.out_channel = out_channel
      self.num_extra_levels = num_extra_levels
      self.num_stacks = num_stacks
      self.use_weighted_fusion = use_weighted_fusion
      self.norm_type = norm_type
      self.norm_groups = norm_groups
      self.act = act
      self.num_levels = len(self.in_channels) + self.num_extra_levels
      if len(fpn_strides) != self.num_levels:
          for i in range(self.num_extra_levels):
              fpn_strides += [fpn_strides[-1] * 2]
      self.fpn_strides = fpn_strides
  
      self.lateral_convs = nn.LayerList()
      for in_c in in_channels:
          self.lateral_convs.append(
              ConvNormLayer(in_c, self.out_channel, 1, 1)
          )
      if self.num_extra_levels > 0:
          self.extra_convs = nn.LayerList()
          for i in range(self.num_extra_levels):
              if i == 0:
                  self.extra_convs.append(
                      ConvNormLayer(
                          self.in_channels[-1], self.out_channel, 3, 2
                      )
                  )
              else:
                  self.extra_convs.append(nn.MaxPool2D(3, 2, 1))
  
      self.bifpn_cells = nn.LayerList()
      for i in range(self.num_stacks):
          self.bifpn_cells.append(
              BiFPNCell(
                  self.out_channel,
                  self.num_levels,
                  use_weighted_fusion=self.use_weighted_fusion,
                  norm_type=self.norm_type,
                  norm_groups=self.norm_groups,
                  act=self.act,
              )
          )
  
imports: import paddle
  import paddle.nn
  import paddle.nn.functional
  from paddle import ParamAttr
  from paddle.nn.initializer import Constant
  from ppdet.core.workspace import register, serializable
  from ppdet.modeling.layers import ConvNormLayer
  from ..shape_spec import ShapeSpec
label_desc: Use image node_id 1 to create a new BiFPN object from inherited base classes: nn with example: obj = BiFPN(in_channels, out_channel, num_extra_levels, fpn_strides, num_stacks, use_weighted_fusion, norm_type, norm_groups, act)