code: def _make_layer(
      self, block, planes, blocks, stride=1, dilation=1, grids=None
  ):
      downsample = None
      if stride != 1 or self.inplanes != planes * block.expansion:
          downsample = nn.Sequential(
              nn.Conv2d(
                  self.inplanes,
                  planes * block.expansion,
                  kernel_size=1,
                  stride=stride,
                  bias=False,
              ),
              nn.BatchNorm2d(planes * block.expansion),
          )
  
      layers = []
      if grids is None:
          grids = [1] * blocks
  
      if dilation in (1, 2):
          layers.append(
              block(
                  self.inplanes,
                  planes,
                  stride,
                  dilation=1,
                  downsample=downsample,
                  previous_dilation=dilation,
              )
          )
      elif dilation == 4:
          layers.append(
              block(
                  self.inplanes,
                  planes,
                  stride,
                  dilation=2,
                  downsample=downsample,
                  previous_dilation=dilation,
              )
          )
      else:
          raise RuntimeError(
              "=> unknown dilation size: {}".format(dilation)
          )
  
      self.inplanes = planes * block.expansion
      for i in range(1, blocks):
          layers.append(
              block(
                  self.inplanes,
                  planes,
                  dilation=dilation * grids[i],
                  previous_dilation=dilation,
              )
          )
  
      return nn.Sequential(*layers)
  
imports: import math
  import torch.utils.model_zoo
  import torch
  import torch.nn
  import torch.nn.functional
  from torch.nn.modules.batchnorm import _BatchNorm
  from .None import settings
label_desc: Use image node_id 2 for calling the ResNet obj's underlying member method code with example usage: obj._make_layer(block, planes, blocks, stride, dilation, grids) and returns: nn