code: def __init__(
      self,
      layers=50,
      num_features=512,
      is_train=True,
      fp16=False,
      fc_type="E",
      dropout=0.4,
  ):
      super(FresResNet, self).__init__()
      self.layers = layers
      self.num_features = num_features
      self.fc_type = fc_type
  
      self.input_dict = OrderedDict()
      self.output_dict = OrderedDict()
  
      image = paddle.static.data(
          name="image",
          shape=[-1, 3, 112, 112],
          dtype="float16" if fp16 else "float32",
      )
      self.input_dict["image"] = image
      if is_train:
          label = paddle.static.data(
              name="label", shape=[-1], dtype="int32"
          )
          self.input_dict["label"] = label
  
      supported_layers = [50, 100, 101, 152]
      assert (
          layers in supported_layers
      ), "supported layers {}, but given {}".format(
          supported_layers, layers
      )
  
      if layers == 50:
          units = [3, 4, 14, 3]
      elif layers == 100:
          units = [3, 13, 30, 3]
      elif layers == 101:
          units = [3, 4, 23, 3]
      elif layers == 152:
          units = [3, 8, 36, 3]
      filter_list = [64, 64, 128, 256, 512]
      num_stages = 4
  
      input_blob = paddle.static.nn.conv2d(
          input=image,
          num_filters=filter_list[0],
          filter_size=3,
          stride=1,
          padding=1,
          groups=1,
          param_attr=paddle.ParamAttr(),
          bias_attr=False,
      )
      input_blob = paddle.static.nn.batch_norm(
          input=input_blob,
          act=None,
          epsilon=1e-05,
          momentum=0.9,
          is_test=False if is_train else True,
      )
      # input_blob = paddle.nn.functional.relu6(input_blob)
      input_blob = paddle.static.nn.prelu(
          input_blob,
          mode="all",
          param_attr=paddle.ParamAttr(
              initializer=paddle.nn.initializer.Constant(0.25)
          ),
      )
  
      for i in range(num_stages):
          for j in range(units[i]):
              input_blob = self.residual_unit_v3(
                  input_blob,
                  filter_list[i + 1],
                  3,
                  2 if j == 0 else 1,
                  1,
                  is_train,
              )
      fc1 = self.get_fc1(input_blob, is_train, dropout)
  
      self.output_dict["feature"] = fc1
  
file_path: insightface/recognition/arcface_paddle/static/backbones/iresnet.py
imports: import paddle
  from collections import OrderedDict
label_desc: Use image node_id 1 to create a new FresResNet object from inherited base classes: object with example: obj = FresResNet(layers, num_features, is_train, fp16, fc_type, dropout)