code: def __init__(
      self, nInputChannels, block, layers, os=16, pretrained=False
  ):
      self.inplanes = 64
      super(ResNet, self).__init__()
      if os == 16:
          strides = [1, 2, 2, 1]
          rates = [1, 1, 1, 2]
          blocks = [1, 2, 4]
      elif os == 8:
          strides = [1, 2, 1, 1]
          rates = [1, 1, 2, 2]
          blocks = [1, 2, 1]
      else:
          raise NotImplementedError
  
      # Modules
      self.conv1 = nn.Conv2d(
          nInputChannels,
          64,
          kernel_size=7,
          stride=2,
          padding=3,
          bias=False,
      )
      self.bn1 = nn.BatchNorm2d(64)
      self.relu = nn.ReLU(inplace=True)
      self.maxpool = nn.MaxPool2d(kernel_size=3, stride=2, padding=1)
  
      self.layer1 = self._make_layer(
          block, 64, layers[0], stride=strides[0], rate=rates[0]
      )
      self.layer2 = self._make_layer(
          block, 128, layers[1], stride=strides[1], rate=rates[1]
      )
      self.layer3 = self._make_layer(
          block, 256, layers[2], stride=strides[2], rate=rates[2]
      )
      self.layer4 = self._make_MG_unit(
          block, 512, blocks=blocks, stride=strides[3], rate=rates[3]
      )
  
      self._init_weight()
  
      if pretrained:
          self._load_pretrained_model()
  
imports: import math
  import torch
  import torch.nn
  import torch.nn.functional
  import torch.utils.model_zoo
label_desc: Use image node_id 1 to create a new ResNet object from inherited base classes: nn with example: obj = ResNet(nInputChannels, block, layers, os, pretrained)