class_docstr: YOLO CSP-PAN, used in YOLOv5 and YOLOX.
class_docstr_tok: ["YOLO","CSP-PAN",",","used","in","YOLOv5","and","YOLOX","."]
code: def __init__(
      self,
      depth_mult=1.0,
      in_channels=[256, 512, 1024],
      depthwise=False,
      data_format="NCHW",
      act="silu",
      trt=False,
  ):
      super(YOLOCSPPAN, self).__init__()
      self.in_channels = in_channels
      self._out_channels = in_channels
      Conv = DWConv if depthwise else BaseConv
  
      self.data_format = data_format
      act = (
          get_act_fn(act, trt=trt)
          if act is None or isinstance(act, (str, dict))
          else act
      )
      self.upsample = nn.Upsample(scale_factor=2, mode="nearest")
  
      # top-down fpn
      self.lateral_convs = nn.LayerList()
      self.fpn_blocks = nn.LayerList()
      for idx in range(len(in_channels) - 1, 0, -1):
          self.lateral_convs.append(
              BaseConv(
                  int(in_channels[idx]),
                  int(in_channels[idx - 1]),
                  1,
                  1,
                  act=act,
              )
          )
          self.fpn_blocks.append(
              CSPLayer(
                  int(in_channels[idx - 1] * 2),
                  int(in_channels[idx - 1]),
                  round(3 * depth_mult),
                  shortcut=False,
                  depthwise=depthwise,
                  act=act,
              )
          )
  
      # bottom-up pan
      self.downsample_convs = nn.LayerList()
      self.pan_blocks = nn.LayerList()
      for idx in range(len(in_channels) - 1):
          self.downsample_convs.append(
              Conv(
                  int(in_channels[idx]),
                  int(in_channels[idx]),
                  3,
                  stride=2,
                  act=act,
              )
          )
          self.pan_blocks.append(
              CSPLayer(
                  int(in_channels[idx] * 2),
                  int(in_channels[idx + 1]),
                  round(3 * depth_mult),
                  shortcut=False,
                  depthwise=depthwise,
                  act=act,
              )
          )
  
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 YOLOCSPPAN object from inherited base classes: nn with example: obj = YOLOCSPPAN(depth_mult, in_channels, depthwise, data_format, act, trt)