code: def __init__(
      self,
      layers=50,
      num_features=512,
      fc_type="E",
      dropout=0.4,
      input_image_channel=3,
      input_image_width=112,
      input_image_height=112,
      data_format="NCHW",
  ):
      super(FresResNet, self).__init__()
  
      self.layers = layers
      self.data_format = data_format
      self.input_image_channel = input_image_channel
  
      supported_layers = [50, 100]
      assert (
          layers in supported_layers
      ), "supported layers are {} but input layer is {}".format(
          supported_layers, layers
      )
  
      if layers == 50:
          units = [3, 4, 14, 3]
      elif layers == 100:
          units = [3, 13, 30, 3]
  
      num_channels = [64, 64, 128, 256]
      num_filters = [64, 128, 256, 512]
  
      self.conv = ConvBNLayer(
          num_channels=self.input_image_channel,
          num_filters=64,
          filter_size=3,
          stride=1,
          act=None,
          name="conv1",
          data_format=self.data_format,
      )
      self.prelu = PReLU(num_parameters=1, name="prelu1")
  
      self.block_list = paddle.nn.LayerList()
      for block in range(len(units)):
          shortcut = True
          for i in range(units[block]):
              conv_name = "res" + str(block + 2) + chr(97 + i)
              basic_block = self.add_sublayer(
                  conv_name,
                  BasicBlock(
                      num_channels=num_channels[block]
                      if i == 0
                      else num_filters[block],
                      num_filters=num_filters[block],
                      stride=2 if shortcut else 1,
                      shortcut=shortcut,
                      name=conv_name,
                      data_format=self.data_format,
                  ),
              )
              self.block_list.append(basic_block)
              shortcut = False
  
      assert input_image_width % 16 == 0
      assert input_image_height % 16 == 0
      feat_w = input_image_width // 16
      feat_h = input_image_height // 16
      self.fc_channels = num_filters[-1] * feat_w * feat_h
      self.fc = FC(
          num_filters[-1],
          self.fc_channels,
          num_features,
          fc_type,
          dropout,
          name="fc",
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  import paddle
  from paddle import ParamAttr
  import paddle.nn
  import paddle.nn.functional
  from paddle.nn import Conv2D, BatchNorm, Linear, Dropout, PReLU
  from paddle.nn import AdaptiveAvgPool2D, MaxPool2D, AvgPool2D
  from paddle.nn.initializer import XavierNormal, Constant
  import math
label_desc: Use image node_id 1 to create a new FresResNet object from inherited base classes: nn with example: obj = FresResNet(layers, num_features, fc_type, dropout, input_image_channel, input_image_width, input_image_height, data_format)