code: def __init__(
      self,
      layer,
      block,
      pretrained=None,
      norm_layer=layers.SyncBatchNorm,
      bn_eps=1e-5,
      bn_momentum=0.1,
      deep_stem=False,
      stem_width=32,
      as_backbone=True,
      in_channels=3,
  ):
      self.inplanes = stem_width * 2 if deep_stem else 64
      super(ResNet, self).__init__()
      if deep_stem:
          self.conv1 = nn.Sequential(
              nn.Conv2D(
                  in_channels,
                  stem_width,
                  kernel_size=3,
                  stride=2,
                  padding=1,
                  bias_attr=False,
              ),
              norm_layer(
                  stem_width, epsilon=bn_eps, momentum=bn_momentum
              ),
              nn.ReLU(),
              nn.Conv2D(
                  stem_width,
                  stem_width,
                  kernel_size=3,
                  stride=1,
                  padding=1,
                  bias_attr=False,
              ),
              norm_layer(
                  stem_width, epsilon=bn_eps, momentum=bn_momentum
              ),
              nn.ReLU(),
              nn.Conv2D(
                  stem_width,
                  stem_width * 2,
                  kernel_size=3,
                  stride=1,
                  padding=1,
                  bias_attr=False,
              ),
          )
      else:
          self.conv1 = nn.Conv2D(
              in_channels,
              64,
              kernel_size=7,
              stride=2,
              padding=3,
              bias_attr=False,
          )
  
      num_filters = [64, 128, 256, 512]
  
      if layer == 18:
          depth = [2, 2, 2, 2]
      elif layer == 34 or layer == 50:
          depth = [3, 4, 6, 3]
      elif layer == 101:
          depth = [3, 4, 23, 3]
      elif layer == 152:
          depth = [3, 8, 36, 3]
      elif layer == 200:
          depth = [3, 12, 48, 3]
  
      # for channels of four returned stages
      self.feat_channels = (
          [c * 4 for c in num_filters] if layer >= 50 else num_filters
      )
  
      self.bn1 = norm_layer(
          stem_width * 2 if deep_stem else 64,
          epsilon=bn_eps,
          momentum=bn_momentum,
      )
      self.relu = nn.ReLU()
      self.maxpool = nn.MaxPool2D(kernel_size=3, stride=2, padding=1)
      self.layer1 = self._make_layer(
          block,
          norm_layer,
          64,
          depth[0],
          bn_eps=bn_eps,
          bn_momentum=bn_momentum,
      )
      self.layer2 = self._make_layer(
          block,
          norm_layer,
          128,
          depth[1],
          stride=2,
          bn_eps=bn_eps,
          bn_momentum=bn_momentum,
      )
      self.layer3 = self._make_layer(
          block,
          norm_layer,
          256,
          depth[2],
          stride=2,
          bn_eps=bn_eps,
          bn_momentum=bn_momentum,
      )
  
      if as_backbone:
          self.layer4 = self._make_layer__nostride_dilate(
              block,
              norm_layer,
              512,
              depth[3],
              stride=1,
              bn_eps=bn_eps,
              bn_momentum=bn_momentum,
          )
      else:
          self.layer4 = self._make_layer(
              block,
              norm_layer,
              512,
              depth[3],
              stride=2,
              bn_eps=bn_eps,
              bn_momentum=bn_momentum,
          )
  
      self.pretrained = pretrained
      self.init_weight()
  
imports: import paddle.nn
  from paddleseg.utils import utils
  from paddleseg.models import layers
  from paddleseg.cvlibs import manager
label_desc: Use image node_id 1 to create a new ResNet object from inherited base classes: nn with example: obj = ResNet(layer, block, pretrained, norm_layer, bn_eps, bn_momentum, deep_stem, stem_width, as_backbone, in_channels)