code: def __init__(
      self,
      width,
      num_classes,
      ocr_width=256,
      small=False,
      norm_layer=nn.BatchNorm2d,
      align_corners=True,
  ):
      super(HighResolutionNet, self).__init__()
      self.norm_layer = norm_layer
      self.width = width
      self.ocr_width = ocr_width
      self.ocr_on = ocr_width > 0
      self.align_corners = align_corners
  
      self.conv1 = nn.Conv2d(
          3, 64, kernel_size=3, stride=2, padding=1, bias=False
      )
      self.bn1 = norm_layer(64)
      self.conv2 = nn.Conv2d(
          64, 64, kernel_size=3, stride=2, padding=1, bias=False
      )
      self.bn2 = norm_layer(64)
      self.relu = nn.ReLU(inplace=relu_inplace)
  
      num_blocks = 2 if small else 4
  
      stage1_num_channels = 64
      self.layer1 = self._make_layer(
          BottleneckV1b, 64, stage1_num_channels, blocks=num_blocks
      )
      stage1_out_channel = BottleneckV1b.expansion * stage1_num_channels
  
      self.stage2_num_branches = 2
      num_channels = [width, 2 * width]
      num_inchannels = [
          num_channels[i] * BasicBlockV1b.expansion
          for i in range(len(num_channels))
      ]
      self.transition1 = self._make_transition_layer(
          [stage1_out_channel], num_inchannels
      )
      self.stage2, pre_stage_channels = self._make_stage(
          BasicBlockV1b,
          num_inchannels=num_inchannels,
          num_modules=1,
          num_branches=self.stage2_num_branches,
          num_blocks=2 * [num_blocks],
          num_channels=num_channels,
      )
  
      self.stage3_num_branches = 3
      num_channels = [width, 2 * width, 4 * width]
      num_inchannels = [
          num_channels[i] * BasicBlockV1b.expansion
          for i in range(len(num_channels))
      ]
      self.transition2 = self._make_transition_layer(
          pre_stage_channels, num_inchannels
      )
      self.stage3, pre_stage_channels = self._make_stage(
          BasicBlockV1b,
          num_inchannels=num_inchannels,
          num_modules=3 if small else 4,
          num_branches=self.stage3_num_branches,
          num_blocks=3 * [num_blocks],
          num_channels=num_channels,
      )
  
      self.stage4_num_branches = 4
      num_channels = [width, 2 * width, 4 * width, 8 * width]
      num_inchannels = [
          num_channels[i] * BasicBlockV1b.expansion
          for i in range(len(num_channels))
      ]
      self.transition3 = self._make_transition_layer(
          pre_stage_channels, num_inchannels
      )
      self.stage4, pre_stage_channels = self._make_stage(
          BasicBlockV1b,
          num_inchannels=num_inchannels,
          num_modules=2 if small else 3,
          num_branches=self.stage4_num_branches,
          num_blocks=4 * [num_blocks],
          num_channels=num_channels,
      )
  
      if self.ocr_on:
          last_inp_channels = np.int32(np.sum(pre_stage_channels))
          ocr_mid_channels = 2 * ocr_width
          ocr_key_channels = ocr_width
  
          self.conv3x3_ocr = nn.Sequential(
              nn.Conv2d(
                  last_inp_channels,
                  ocr_mid_channels,
                  kernel_size=3,
                  stride=1,
                  padding=1,
              ),
              norm_layer(ocr_mid_channels),
              nn.ReLU(inplace=relu_inplace),
          )
          self.ocr_gather_head = SpatialGather_Module(num_classes)
  
          self.ocr_distri_head = SpatialOCR_Module(
              in_channels=ocr_mid_channels,
              key_channels=ocr_key_channels,
              out_channels=ocr_mid_channels,
              scale=1,
              dropout=0.05,
              norm_layer=norm_layer,
              align_corners=align_corners,
          )
  
imports: import os
  import torch
  import torch._utils
  import numpy
  import torch.nn
  import torch.nn.functional
  from cftool.misc import print_info
  from .ocr import SpatialOCR_Module
  from .ocr import SpatialGather_Module
  from .resnetv1b import BottleneckV1b
  from .resnetv1b import BasicBlockV1b
label_desc: Use image node_id 1 to create a new HighResolutionNet object from inherited base classes: nn with example: obj = HighResolutionNet(width, num_classes, ocr_width, small, norm_layer, align_corners)