code: def __init__(
      self,
      layers=[3, 6, 6, 3],
      channels=[64, 128, 256, 512, 1024],
      act="swish",
      return_idx=[1, 2, 3],
      depth_wise=False,
      use_large_stem=False,
      width_mult=1.0,
      depth_mult=1.0,
      trt=False,
      use_checkpoint=False,
      use_alpha=False,
      **args,
  ):
      super(CSPResNet, self).__init__()
      self.use_checkpoint = use_checkpoint
      channels = [max(round(c * width_mult), 1) for c in channels]
      layers = [max(round(l * depth_mult), 1) for l in layers]
      act = (
          get_act_fn(act, trt=trt)
          if act is None or isinstance(act, (str, dict))
          else act
      )
  
      if use_large_stem:
          self.stem = nn.Sequential(
              (
                  "conv1",
                  ConvBNLayer(
                      3,
                      channels[0] // 2,
                      3,
                      stride=2,
                      padding=1,
                      act=act,
                  ),
              ),
              (
                  "conv2",
                  ConvBNLayer(
                      channels[0] // 2,
                      channels[0] // 2,
                      3,
                      stride=1,
                      padding=1,
                      act=act,
                  ),
              ),
              (
                  "conv3",
                  ConvBNLayer(
                      channels[0] // 2,
                      channels[0],
                      3,
                      stride=1,
                      padding=1,
                      act=act,
                  ),
              ),
          )
      else:
          self.stem = nn.Sequential(
              (
                  "conv1",
                  ConvBNLayer(
                      3,
                      channels[0] // 2,
                      3,
                      stride=2,
                      padding=1,
                      act=act,
                  ),
              ),
              (
                  "conv2",
                  ConvBNLayer(
                      channels[0] // 2,
                      channels[0],
                      3,
                      stride=1,
                      padding=1,
                      act=act,
                  ),
              ),
          )
  
      n = len(channels) - 1
      self.stages = nn.Sequential(
          *[
              (
                  str(i),
                  CSPResStage(
                      BasicBlock,
                      channels[i],
                      channels[i + 1],
                      layers[i],
                      2,
                      act=act,
                      use_alpha=use_alpha,
                  ),
              )
              for i in range(n)
          ]
      )
  
      self._out_channels = channels[1:]
      self._out_strides = [4 * 2**i for i in range(n)]
      self.return_idx = return_idx
      if use_checkpoint:
          paddle.seed(0)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import paddle
  import paddle.nn
  import paddle.nn.functional
  from paddle import ParamAttr
  from paddle.regularizer import L2Decay
  from paddle.nn.initializer import Constant
  from ppdet.modeling.ops import get_act_fn
  from ppdet.core.workspace import register, serializable
  from ..shape_spec import ShapeSpec
label_desc: Use image node_id 1 to create a new CSPResNet object from inherited base classes: nn with example: obj = CSPResNet(layers, channels, act, return_idx, depth_wise, use_large_stem, width_mult, depth_mult, trt, use_checkpoint, use_alpha)