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_layer(
      self,
      block,
      inplanes,
      planes,
      blocks,
      num_heads=1,
      stride=1,
      window_size=7,
      mlp_ratio=4.0,
  ):
      downsample = None
      if stride != 1 or inplanes != planes * block.expansion:
          downsample = nn.Sequential(
              layers.ConvBN(
                  inplanes,
                  planes * block.expansion,
                  kernel_size=1,
                  stride=stride,
                  bias_attr=False,
              )
          )
      modules = []
  
      if isinstance(block, GeneralTransformerBlock):
          modules.append(
              block(
                  inplanes,
                  planes,
                  num_heads,
                  window_size,
                  mlp_ratio,
              )
          )
      else:
          modules.append(block(inplanes, planes, stride, downsample))
  
      inplanes = planes * block.expansion
      for _ in range(1, blocks):
          modules.append(block(inplanes, planes))
  
      return nn.Sequential(*modules)
  
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 3 for calling the HighResolutionTransformer obj's underlying member method code with example usage: obj._make_layer(block, inplanes, planes, blocks, num_heads, stride, window_size, mlp_ratio) and returns: nn