code: def __init__(
      self,
      class_num=1000,
      data_format="NCHW",
      input_image_channel=3,
      use_pure_fp16=False,
      bn_weight_decay=True,
  ):
      super().__init__()
  
      self.class_num = class_num
      self.num_filters = [64, 128, 256, 512]
      self.block_depth = [3, 4, 6, 3]
      self.num_channels = [64, 256, 512, 1024]
      self.channels_mult = 1 if self.num_channels[-1] == 256 else 4
      self.use_pure_fp16 = use_pure_fp16
  
      self.stem_cfg = {
          # num_channels, num_filters, filter_size, stride
          "vb": [[input_image_channel, 64, 7, 2]],
      }
      self.stem = nn.Sequential(
          *[
              ConvBNLayer(
                  num_channels=in_c,
                  num_filters=out_c,
                  filter_size=k,
                  stride=s,
                  act="relu",
                  data_format=data_format,
                  bn_weight_decay=bn_weight_decay,
              )
              for in_c, out_c, k, s in self.stem_cfg["vb"]
          ]
      )
  
      self.max_pool = MaxPool2D(
          kernel_size=3, stride=2, padding=1, data_format=data_format
      )
      block_list = []
      for block_idx in range(len(self.block_depth)):
          shortcut = False
          for i in range(self.block_depth[block_idx]):
              block_list.append(
                  BottleneckBlock(
                      num_channels=self.num_channels[block_idx]
                      if i == 0
                      else self.num_filters[block_idx]
                      * self.channels_mult,
                      num_filters=self.num_filters[block_idx],
                      stride=2 if i == 0 and block_idx != 0 else 1,
                      shortcut=shortcut,
                      data_format=data_format,
                      bn_weight_decay=bn_weight_decay,
                  )
              )
              shortcut = True
      self.blocks = nn.Sequential(*block_list)
  
      self.avg_pool = AdaptiveAvgPool2D(1, data_format=data_format)
      self.flatten = nn.Flatten()
      self.avg_pool_channels = self.num_channels[-1] * 2
      stdv = 1.0 / math.sqrt(self.avg_pool_channels * 1.0)
      self.fc = Linear(
          self.avg_pool_channels,
          self.class_num,
          weight_attr=ParamAttr(initializer=Uniform(-stdv, stdv)),
      )
  
imports: import math
  import paddle
  from paddle import ParamAttr
  import paddle.nn
  from paddle.nn import Conv2D, BatchNorm, Linear
  from paddle.nn import AdaptiveAvgPool2D, MaxPool2D, AvgPool2D
  from paddle.nn.initializer import Uniform, Constant, KaimingNormal
label_desc: Use image node_id 1 to create a new ResNet object from inherited base classes: nn with example: obj = ResNet(class_num, data_format, input_image_channel, use_pure_fp16, bn_weight_decay)