code: def __init__(
      self, input_channels=3, width=48, layers: List[int] = None
  ):
      if layers is None:
          layers = [1, 2, 3, 4]
  
      channels = [64, width, width * 2, width * 4, width * 8]
  
      strides = [4, 4, 8, 16, 32]
  
      super().__init__(
          channels=channels, strides=strides, layers=layers
      )
  
      blocks_dict = {
          "BASIC": HRNetBasicBlock,
          "BOTTLENECK": HRNetBottleneck,
      }
  
      extra = {
          "STAGE2": {
              "NUM_MODULES": 1,
              "NUM_BRANCHES": 2,
              "BLOCK": "BASIC",
              "NUM_BLOCKS": (4, 4),
              "NUM_CHANNELS": (width, width * 2),
              "FUSE_METHOD": "SUM",
          },
          "STAGE3": {
              "NUM_MODULES": 4,
              "NUM_BRANCHES": 3,
              "BLOCK": "BASIC",
              "NUM_BLOCKS": (4, 4, 4),
              "NUM_CHANNELS": (width, width * 2, width * 4),
              "FUSE_METHOD": "SUM",
          },
          "STAGE4": {
              "NUM_MODULES": 3,
              "NUM_BRANCHES": 4,
              "BLOCK": "BASIC",
              "NUM_BLOCKS": (4, 4, 4, 4),
              "NUM_CHANNELS": (width, width * 2, width * 4, width * 8),
              "FUSE_METHOD": "SUM",
          },
          "FINAL_CONV_KERNEL": 1,
      }
  
      # stem net
      self.layer0 = nn.Sequential(
          OrderedDict(
              [
                  (
                      "conv1",
                      nn.Conv2d(
                          input_channels,
                          64,
                          kernel_size=3,
                          stride=2,
                          padding=1,
                          bias=False,
                      ),
                  ),
                  (
                      "bn1",
                      nn.BatchNorm2d(64, momentum=HRNETV2_BN_MOMENTUM),
                  ),
                  ("relu", nn.ReLU(inplace=True)),
                  (
                      "conv2",
                      nn.Conv2d(
                          64,
                          64,
                          kernel_size=3,
                          stride=2,
                          padding=1,
                          bias=False,
                      ),
                  ),
                  (
                      "bn2",
                      nn.BatchNorm2d(64, momentum=HRNETV2_BN_MOMENTUM),
                  ),
                  ("relu2", nn.ReLU(inplace=True)),
              ]
          )
      )
  
      self.layer1 = self._make_layer(HRNetBottleneck, 64, 64, 4)
  
      self.stage2_cfg = extra["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(
          [256], num_channels
      )
      self.stage2, pre_stage_channels = self._make_stage(
          self.stage2_cfg, num_channels
      )
  
      self.stage3_cfg = extra["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
      )
  
      self.stage4_cfg = extra["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
      )
  
imports: from collections import OrderedDict
  from typing import List
  import torch
  import torch.nn.functional
  from torch import nn
  from .common import EncoderModule, make_n_channel_input, _take
label_desc: Use image node_id 1 to create a new HRNetEncoderBase object from inherited base classes: EncoderModule with example: obj = HRNetEncoderBase(input_channels, width, layers)