class_docstr: The HRFormer implementation based on PaddlePaddle.
  
  The original article refers to
  Jingdong Wang, et, al. "HRNet：Deep High-Resolution Representation Learning for Visual Recognition"
  (https://arxiv.org/pdf/1908.07919.pdf).
  
  Args:
      drop_path_rate (float, optional): The rate of Drop Path. Default: 0.2.
      stage1_num_blocks (list[int], optional): Number of blocks per module for stage1. Default: [2].
      stage1_num_channels (list[int], optional): Number of channels per branch for stage1. Default: [64].
      stage2_num_modules (int, optional): Number of modules for stage2. Default: 1.
      stage2_num_branches (int, optional): Number of branches for stage2. Default: 2.
      stage2_num_blocks (list[int], optional): Number of blocks per module for stage2. Default: [2, 2].
      stage2_num_channels (list[int], optional): Number of channels per branch for stage2. Default: [32, 64].
      stage2_num_heads (list[int], optional): Number of heads per multi head attetion for stage2. Default: [1, 2].
      stage2_num_mlp_ratios (list[int], optional): Number of ratio of mlp per multi head attetion for stage2. Default: [4, 4].
      stage2_num_window_sizes (list[int], optional): Number of window sizes for stage2. Default: [7, 7].
      stage3_num_modules (int, optional): Number of modules for stage3. Default: 4.
      stage3_num_branches (int, optional): Number of branches for stage3. Default: 3.
      stage3_num_blocks (list[int], optional): Number of blocks per module for stage3. Default: [2, 2, 2].
      stage3_num_channels (list[int], optional): Number of channels per branch for stage3. Default: [32, 64, 128].
      stage3_num_heads (list[int], optional): Number of heads per multi head attetion for stage3. Default: [1, 2, 4].
      stage3_num_mlp_ratios (list[int], optional): Number of ratio of mlp per multi head attetion for stage3. Default: [4, 4, 4].
      stage3_num_window_sizes (list[int], optional): Number of window sizes for stage3. Default: [7, 7, 7].
      stage4_num_modules (int, optional): Number of modules for stage4. Default: 2.
      stage4_num_branches (int, optional): Number of branches for stage4. Default: 4.
      stage4_num_blocks (list[int], optional): Number of blocks per module for stage4. Default: [2, 2, 2, 2].
      stage4_num_channels (list[int], optional): Number of channels per branch for stage4. Default: [32, 64, 128, 256].
      stage4_num_heads (list[int], optional): Number of heads per multi head attetion for stage4. Default: [1, 2, 4, 8].
      stage4_num_mlp_ratios (list[int], optional): Number of ratio of mlp per multi head attetion for stage4. Default: [4, 4, 4, 4].
      stage4_num_window_sizes (list[int], optional): Number of window sizes for stage4. Default: [7, 7, 7, 7].
      in_channels (int, optional): The channels of input image. Default: 3.
      pretrained (str, optional): The path of pretrained model. Default: None.
class_docstr_tok: ["The","HRFormer","implementation","based","on","PaddlePaddle",".","The","original","article","refers","to","Jingdong","Wang",",","et",",","al",".","``","HRNet\uff1aDeep","High-Resolution","Representation","Learning","for","Visual","Recognition","''","(","https",":","\/\/arxiv.org\/pdf\/1908.07919.pdf",")",".","Args",":","drop_path_rate","(","float",",","optional",")",":","The","rate","of","Drop","Path",".","Default",":","0.2.","stage1_num_blocks","(","list","[","int","]",",","optional",")",":","Number","of","blocks","per","module","for","stage1",".","Default",":","[","2","]",".","stage1_num_channels","(","list","[","int","]",",","optional",")",":","Number","of","channels","per","branch","for","stage1",".","Default",":","[","64","]",".","stage2_num_modules","(","int",",","optional",")",":","Number","of","modules","for","stage2",".","Default",":","1.","stage2_num_branches","(","int",",","optional",")",":","Number","of","branches","for","stage2",".","Default",":","2.","stage2_num_blocks","(","list","[","int","]",",","optional",")",":","Number","of","blocks","per","module","for","stage2",".","Default",":","[","2",",","2","]",".","stage2_num_channels","(","list","[","int","]",",","optional",")",":","Number","of","channels","per","branch","for","stage2",".","Default",":","[","32",",","64","]",".","stage2_num_heads","(","list","[","int","]",",","optional",")",":","Number","of","heads","per","multi","head","attetion","for","stage2",".","Default",":","[","1",",","2","]",".","stage2_num_mlp_ratios","(","list","[","int","]",",","optional",")",":","Number","of","ratio","of","mlp","per","multi","head","attetion","for","stage2",".","Default",":","[","4",",","4","]",".","stage2_num_window_sizes","(","list","[","int","]",",","optional",")",":","Number","of","window","sizes","for","stage2",".","Default",":","[","7",",","7","]",".","stage3_num_modules","(","int",",","optional",")",":","Number","of","modules","for","stage3",".","Default",":","4.","stage3_num_branches","(","int",",","optional",")",":","Number","of","branches","for","stage3",".","Default",":","3.","stage3_num_blocks","(","list","[","int","]",",","optional",")",":","Number","of","blocks","per","module","for","stage3",".","Default",":","[","2",",","2",",","2","]",".","stage3_num_channels","(","list","[","int","]",",","optional",")",":","Number","of","channels","per","branch","for","stage3",".","Default",":","[","32",",","64",",","128","]",".","stage3_num_heads","(","list","[","int","]",",","optional",")",":","Number","of","heads","per","multi","head","attetion","for","stage3",".","Default",":","[","1",",","2",",","4","]",".","stage3_num_mlp_ratios","(","list","[","int","]",",","optional",")",":","Number","of","ratio","of","mlp","per","multi","head","attetion","for","stage3",".","Default",":","[","4",",","4",",","4","]",".","stage3_num_window_sizes","(","list","[","int","]",",","optional",")",":","Number","of","window","sizes","for","stage3",".","Default",":","[","7",",","7",",","7","]",".","stage4_num_modules","(","int",",","optional",")",":","Number","of","modules","for","stage4",".","Default",":","2.","stage4_num_branches","(","int",",","optional",")",":","Number","of","branches","for","stage4",".","Default",":","4.","stage4_num_blocks","(","list","[","int","]",",","optional",")",":","Number","of","blocks","per","module","for","stage4",".","Default",":","[","2",",","2",",","2",",","2","]",".","stage4_num_channels","(","list","[","int","]",",","optional",")",":","Number","of","channels","per","branch","for","stage4",".","Default",":","[","32",",","64",",","128",",","256","]",".","stage4_num_heads","(","list","[","int","]",",","optional",")",":","Number","of","heads","per","multi","head","attetion","for","stage4",".","Default",":","[","1",",","2",",","4",",","8","]",".","stage4_num_mlp_ratios","(","list","[","int","]",",","optional",")",":","Number","of","ratio","of","mlp","per","multi","head","attetion","for","stage4",".","Default",":","[","4",",","4",",","4",",","4","]",".","stage4_num_window_sizes","(","list","[","int","]",",","optional",")",":","Number","of","window","sizes","for","stage4",".","Default",":","[","7",",","7",",","7",",","7","]",".","in_channels","(","int",",","optional",")",":","The","channels","of","input","image",".","Default",":","3.","pretrained","(","str",",","optional",")",":","The","path","of","pretrained","model",".","Default",":","None","."]
code: def _make_stage(
      self,
      block,
      num_modules,
      num_branches,
      num_blocks,
      num_channels,
      num_heads,
      num_window_sizes,
      num_mlp_ratios,
      num_inchannels,
      multi_scale_output=True,
      drop_path=0.0,
  ):
      modules = []
      for i in range(num_modules):
          # multi_scale_output is only used last module
          if not multi_scale_output and i == num_modules - 1:
              reset_multi_scale_output = False
          else:
              reset_multi_scale_output = True
  
          modules.append(
              HighResolutionTransformerModule(
                  num_branches,
                  block,
                  num_blocks,
                  num_inchannels,
                  num_channels,
                  num_heads,
                  num_window_sizes,
                  num_mlp_ratios,
                  reset_multi_scale_output,
                  drop_path=drop_path[
                      num_blocks[0] * i : num_blocks[0] * (i + 1)
                  ],
              )
          )
          num_inchannels = modules[-1].num_inchannels
  
      return nn.Sequential(*modules), num_inchannels
  
imports: import paddle
  import paddle.nn
  import paddle.nn.functional
  from paddleseg.cvlibs import manager, param_init
  from paddleseg.models import layers
  from paddleseg.utils import utils, logger
  from paddleseg.models.backbones.transformer_utils import *
label_desc: Use image node_id 4 for calling the HighResolutionTransformer obj's underlying member method code with example usage: obj._make_stage(block, num_modules, num_branches, num_blocks, num_channels, num_heads, num_window_sizes, num_mlp_ratios, num_inchannels, multi_scale_output, drop_path) and returns: nn,  num_inchannels