code: def __init__(self, block, layers, in_channels=3, dcn=None):
      self.dcn = dcn
      self.inplanes = 64
      super(ResNet, self).__init__()
      self.out_channels = []
      self.conv1 = nn.Conv2D(
          in_channels,
          64,
          kernel_size=7,
          stride=2,
          padding=3,
          bias_attr=False,
      )
      self.bn1 = BatchNorm2d(64, momentum=0.1)
      self.relu = nn.ReLU()
      self.maxpool = nn.MaxPool2D(kernel_size=3, stride=2, padding=1)
      self.layer1 = self._make_layer(block, 64, layers[0])
      self.layer2 = self._make_layer(
          block, 128, layers[1], stride=2, dcn=dcn
      )
      self.layer3 = self._make_layer(
          block, 256, layers[2], stride=2, dcn=dcn
      )
      self.layer4 = self._make_layer(
          block, 512, layers[3], stride=2, dcn=dcn
      )
  
      if self.dcn is not None:
          for m in self.modules():
              if isinstance(m, Bottleneck) or isinstance(m, BasicBlock):
                  if hasattr(m, "conv2_offset"):
                      constant_init(m.conv2_offset, 0)
  
imports: import math
  import paddle
  from paddle import nn
label_desc: Use image node_id 1 to create a new ResNet object from inherited base classes: nn with example: obj = ResNet(block, layers, in_channels, dcn)