code: def _make_layer(self, block, planes, block_num, stride=1):
      if block_num == 0:
          return nn.Sequential(nn.Identity())
      norm_layer = self._norm_layer
      downsample = None
      if stride != 1:
          downsample = nn.Sequential(
              nn.AvgPool2D(2, stride),
              nn.utils.spectral_norm(
                  conv1x1(self.inplanes, planes * block.expansion)
              ),
              norm_layer(planes * block.expansion),
          )
      elif self.inplanes != planes * block.expansion:
          downsample = nn.Sequential(
              nn.utils.spectral_norm(
                  conv1x1(
                      self.inplanes, planes * block.expansion, stride
                  )
              ),
              norm_layer(planes * block.expansion),
          )
  
      layers = [
          block(self.inplanes, planes, stride, downsample, norm_layer)
      ]
      self.inplanes = planes * block.expansion
      for _ in range(1, block_num):
          layers.append(
              block(self.inplanes, planes, norm_layer=norm_layer)
          )
  
      return nn.Sequential(*layers)
  
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 2 for calling the ResNet_D obj's underlying member method code with example usage: obj._make_layer(block, planes, block_num, stride) and returns: nn, nn