code: def __init__(
      self,
      input_channels,
      layers,
      late_downsample=False,
      pretrained=None,
  ):
      super().__init__()
  
      self.pretrained = pretrained
  
      self._norm_layer = nn.BatchNorm
      self.inplanes = 64
      self.late_downsample = late_downsample
      self.midplanes = 64 if late_downsample else 32
      self.start_stride = (
          [1, 2, 1, 2] if late_downsample else [2, 1, 2, 1]
      )
      self.conv1 = nn.utils.spectral_norm(
          nn.Conv2D(
              input_channels,
              32,
              kernel_size=3,
              stride=self.start_stride[0],
              padding=1,
              bias_attr=False,
          )
      )
      self.conv2 = nn.utils.spectral_norm(
          nn.Conv2D(
              32,
              self.midplanes,
              kernel_size=3,
              stride=self.start_stride[1],
              padding=1,
              bias_attr=False,
          )
      )
      self.conv3 = nn.utils.spectral_norm(
          nn.Conv2D(
              self.midplanes,
              self.inplanes,
              kernel_size=3,
              stride=self.start_stride[2],
              padding=1,
              bias_attr=False,
          )
      )
      self.bn1 = self._norm_layer(32)
      self.bn2 = self._norm_layer(self.midplanes)
      self.bn3 = self._norm_layer(self.inplanes)
      self.activation = nn.ReLU()
      self.layer1 = self._make_layer(
          BasicBlock, 64, layers[0], stride=self.start_stride[3]
      )
      self.layer2 = self._make_layer(
          BasicBlock, 128, layers[1], stride=2
      )
      self.layer3 = self._make_layer(
          BasicBlock, 256, layers[2], stride=2
      )
      self.layer_bottleneck = self._make_layer(
          BasicBlock, 512, layers[3], stride=2
      )
  
      self.init_weight()
  
imports: import paddle
  import paddle.nn
  import paddle.nn.functional
  from paddleseg.cvlibs import manager, param_init
  from paddleseg.utils import utils
  from ppmatting.models.layers import GuidedCxtAtten
label_desc: Use image node_id 1 to create a new ResNet_D object from inherited base classes: nn with example: obj = ResNet_D(input_channels, layers, late_downsample, pretrained)