code: def __init__(self, cfg, norm_layer=None):
      super(HighResolutionNet, self).__init__()
  
      if norm_layer is None:
          norm_layer = nn.BatchNorm2d
      self.norm_layer = norm_layer
      # stem network
      # stem net
      self.conv1 = nn.Conv2d(
          3, 64, kernel_size=3, stride=2, padding=1, bias=False
      )
      self.bn1 = self.norm_layer(64)
      self.conv2 = nn.Conv2d(
          64, 64, kernel_size=3, stride=2, padding=1, bias=False
      )
      self.bn2 = self.norm_layer(64)
      self.relu = nn.ReLU(inplace=True)
  
      # stage 1
      self.stage1_cfg = cfg["STAGE1"]
      num_channels = self.stage1_cfg["NUM_CHANNELS"][0]
      block = blocks_dict[self.stage1_cfg["BLOCK"]]
      num_blocks = self.stage1_cfg["NUM_BLOCKS"][0]
      self.layer1 = self._make_layer(
          block, 64, num_channels, num_blocks
      )
      stage1_out_channel = block.expansion * num_channels
  
      # stage 2
      self.stage2_cfg = cfg["STAGE2"]
      num_channels = self.stage2_cfg["NUM_CHANNELS"]
      block = blocks_dict[self.stage2_cfg["BLOCK"]]
      num_channels = [
          num_channels[i] * block.expansion
          for i in range(len(num_channels))
      ]
      self.transition1 = self._make_transition_layer(
          [stage1_out_channel], num_channels
      )
      self.stage2, pre_stage_channels = self._make_stage(
          self.stage2_cfg, num_channels
      )
  
      # stage 3
      self.stage3_cfg = cfg["STAGE3"]
      num_channels = self.stage3_cfg["NUM_CHANNELS"]
      block = blocks_dict[self.stage3_cfg["BLOCK"]]
      num_channels = [
          num_channels[i] * block.expansion
          for i in range(len(num_channels))
      ]
      self.transition2 = self._make_transition_layer(
          pre_stage_channels, num_channels
      )
      self.stage3, pre_stage_channels = self._make_stage(
          self.stage3_cfg, num_channels
      )
  
      # stage 4
      self.stage4_cfg = cfg["STAGE4"]
      num_channels = self.stage4_cfg["NUM_CHANNELS"]
      block = blocks_dict[self.stage4_cfg["BLOCK"]]
      num_channels = [
          num_channels[i] * block.expansion
          for i in range(len(num_channels))
      ]
      self.transition3 = self._make_transition_layer(
          pre_stage_channels, num_channels
      )
      self.stage4, pre_stage_channels = self._make_stage(
          self.stage4_cfg, num_channels, multi_scale_output=True
      )
  
      last_inp_channels = np.int(np.sum(pre_stage_channels))
  
      self.last_layer = nn.Sequential(
          nn.Conv2d(
              in_channels=last_inp_channels,
              out_channels=last_inp_channels,
              kernel_size=1,
              stride=1,
              padding=0,
          ),
          self.norm_layer(last_inp_channels),
          nn.ReLU(inplace=True),
          nn.Conv2d(
              in_channels=last_inp_channels,
              out_channels=19,
              kernel_size=1,
              stride=1,
              padding=0,
          ),
      )
  
imports: import numpy
  import logging
  import torch
  import torch.nn
  import torch.nn.functional
  from torchvision.models.utils import load_state_dict_from_url
label_desc: Use image node_id 1 to create a new HighResolutionNet object from inherited base classes: nn with example: obj = HighResolutionNet(cfg, norm_layer)