docstr: YOLOv3FPN layer
  
  Args:
      in_channels (list): input channels for fpn
      norm_type (str): batch norm type, default bn
      data_format (str): data format, NCHW or NHWC
docstr_tok: ["YOLOv3FPN","layer","Args",":","in_channels","(","list",")",":","input","channels","for","fpn","norm_type","(","str",")",":","batch","norm","type",",","default","bn","data_format","(","str",")",":","data","format",",","NCHW","or","NHWC"]
code: def __init__(
      self,
      in_channels=[256, 512, 1024],
      norm_type="bn",
      freeze_norm=False,
      data_format="NCHW",
  ):
      """
      YOLOv3FPN layer
  
      Args:
          in_channels (list): input channels for fpn
          norm_type (str): batch norm type, default bn
          data_format (str): data format, NCHW or NHWC
  
      """
      super(YOLOv3FPN, self).__init__()
      assert len(in_channels) > 0, "in_channels length should > 0"
      self.in_channels = in_channels
      self.num_blocks = len(in_channels)
  
      self._out_channels = []
      self.yolo_blocks = []
      self.routes = []
      self.data_format = data_format
      for i in range(self.num_blocks):
          name = "yolo_block.{}".format(i)
          in_channel = in_channels[-i - 1]
          if i > 0:
              in_channel += 512 // (2**i)
          yolo_block = self.add_sublayer(
              name,
              YoloDetBlock(
                  in_channel,
                  channel=512 // (2**i),
                  norm_type=norm_type,
                  freeze_norm=freeze_norm,
                  data_format=data_format,
                  name=name,
              ),
          )
          self.yolo_blocks.append(yolo_block)
          # tip layer output channel doubled
          self._out_channels.append(1024 // (2**i))
  
          if i < self.num_blocks - 1:
              name = "yolo_transition.{}".format(i)
              route = self.add_sublayer(
                  name,
                  ConvBNLayer(
                      ch_in=512 // (2**i),
                      ch_out=256 // (2**i),
                      filter_size=1,
                      stride=1,
                      padding=0,
                      norm_type=norm_type,
                      freeze_norm=freeze_norm,
                      data_format=data_format,
                      name=name,
                  ),
              )
              self.routes.append(route)
  
imports: import paddle
  import paddle.nn
  import paddle.nn.functional
  from ppdet.core.workspace import register, serializable
  from ppdet.modeling.layers import DropBlock
  from ppdet.modeling.ops import get_act_fn
  from ..backbones.darknet import ConvBNLayer
  from ..shape_spec import ShapeSpec
  from ..backbones.csp_darknet import BaseConv, DWConv, CSPLayer
label_desc: Use image node_id 1 to create a new YOLOv3FPN object from inherited base classes: nn with example: obj = YOLOv3FPN(in_channels, norm_type, freeze_norm, data_format)