class_docstr: The HRNet 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:
      stage1_num_modules (int, optional): Number of modules for stage1. Default 1.
      stage1_num_blocks (list, optional): Number of blocks per module for stage1. Default (4).
      stage1_num_channels (list, optional): Number of channels per branch for stage1. Default (64).
      stage2_num_modules (int, optional): Number of modules for stage2. Default 1.
      stage2_num_blocks (list, optional): Number of blocks per module for stage2. Default (4, 4).
      stage2_num_channels (list, optional): Number of channels per branch for stage2. Default (18, 36).
      stage3_num_modules (int, optional): Number of modules for stage3. Default 4.
      stage3_num_blocks (list, optional): Number of blocks per module for stage3. Default (4, 4, 4).
      stage3_num_channels (list, optional): Number of channels per branch for stage3. Default (18, 36, 72).
      stage4_num_modules (int, optional): Number of modules for stage4. Default 3.
      stage4_num_blocks (list, optional): Number of blocks per module for stage4. Default (4, 4, 4, 4).
      stage4_num_channels (list, optional): Number of channels per branch for stage4. Default (18, 36, 72. 144).
      has_se (bool, optional): Whether to use Squeeze-and-Excitation module. Default False.
      align_corners (bool, optional): An argument of F.interpolate. It should be set to False when the feature size is even,
          e.g. 1024x512, otherwise it is True, e.g. 769x769. Default: False.
class_docstr_tok: ["The","HRNet","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",":","stage1_num_modules","(","int",",","optional",")",":","Number","of","modules","for","stage1",".","Default","1.","stage1_num_blocks","(","list",",","optional",")",":","Number","of","blocks","per","module","for","stage1",".","Default","(","4",")",".","stage1_num_channels","(","list",",","optional",")",":","Number","of","channels","per","branch","for","stage1",".","Default","(","64",")",".","stage2_num_modules","(","int",",","optional",")",":","Number","of","modules","for","stage2",".","Default","1.","stage2_num_blocks","(","list",",","optional",")",":","Number","of","blocks","per","module","for","stage2",".","Default","(","4",",","4",")",".","stage2_num_channels","(","list",",","optional",")",":","Number","of","channels","per","branch","for","stage2",".","Default","(","18",",","36",")",".","stage3_num_modules","(","int",",","optional",")",":","Number","of","modules","for","stage3",".","Default","4.","stage3_num_blocks","(","list",",","optional",")",":","Number","of","blocks","per","module","for","stage3",".","Default","(","4",",","4",",","4",")",".","stage3_num_channels","(","list",",","optional",")",":","Number","of","channels","per","branch","for","stage3",".","Default","(","18",",","36",",","72",")",".","stage4_num_modules","(","int",",","optional",")",":","Number","of","modules","for","stage4",".","Default","3.","stage4_num_blocks","(","list",",","optional",")",":","Number","of","blocks","per","module","for","stage4",".","Default","(","4",",","4",",","4",",","4",")",".","stage4_num_channels","(","list",",","optional",")",":","Number","of","channels","per","branch","for","stage4",".","Default","(","18",",","36",",","72",".","144",")",".","has_se","(","bool",",","optional",")",":","Whether","to","use","Squeeze-and-Excitation","module",".","Default","False",".","align_corners","(","bool",",","optional",")",":","An","argument","of","F.interpolate",".","It","should","be","set","to","False","when","the","feature","size","is","even",",","e.g",".","1024x512",",","otherwise","it","is","True",",","e.g",".","769x769",".","Default",":","False","."]
code: def __init__(
      self,
      stage1_num_modules: int = 1,
      stage1_num_blocks: Tuple[int] = (4,),
      stage1_num_channels: Tuple[int] = (64,),
      stage2_num_modules: int = 1,
      stage2_num_blocks: Tuple[int] = (4, 4),
      stage2_num_channels: Tuple[int] = (18, 36),
      stage3_num_modules: int = 4,
      stage3_num_blocks: Tuple[int] = (4, 4, 4),
      stage3_num_channels: Tuple[int] = (18, 36, 72),
      stage4_num_modules: int = 3,
      stage4_num_blocks: Tuple[int] = (4, 4, 4, 4),
      stage4_num_channels: Tuple[int] = (18, 36, 72, 144),
      has_se: bool = False,
      align_corners: bool = False,
  ):
      super(HRNet_W18, self).__init__()
  
      self.stage1_num_modules = stage1_num_modules
      self.stage1_num_blocks = stage1_num_blocks
      self.stage1_num_channels = stage1_num_channels
      self.stage2_num_modules = stage2_num_modules
      self.stage2_num_blocks = stage2_num_blocks
      self.stage2_num_channels = stage2_num_channels
      self.stage3_num_modules = stage3_num_modules
      self.stage3_num_blocks = stage3_num_blocks
      self.stage3_num_channels = stage3_num_channels
      self.stage4_num_modules = stage4_num_modules
      self.stage4_num_blocks = stage4_num_blocks
      self.stage4_num_channels = stage4_num_channels
      self.has_se = has_se
      self.align_corners = align_corners
      self.feat_channels = [sum(stage4_num_channels)]
  
      self.conv_layer1_1 = L.ConvBNReLU(
          in_channels=3,
          out_channels=64,
          kernel_size=3,
          stride=2,
          padding="same",
          bias_attr=False,
      )
  
      self.conv_layer1_2 = L.ConvBNReLU(
          in_channels=64,
          out_channels=64,
          kernel_size=3,
          stride=2,
          padding="same",
          bias_attr=False,
      )
  
      self.la1 = Layer1(
          num_channels=64,
          num_blocks=self.stage1_num_blocks[0],
          num_filters=self.stage1_num_channels[0],
          has_se=has_se,
          name="layer2",
      )
  
      self.tr1 = TransitionLayer(
          in_channels=[self.stage1_num_channels[0] * 4],
          out_channels=self.stage2_num_channels,
          name="tr1",
      )
  
      self.st2 = Stage(
          num_channels=self.stage2_num_channels,
          num_modules=self.stage2_num_modules,
          num_blocks=self.stage2_num_blocks,
          num_filters=self.stage2_num_channels,
          has_se=self.has_se,
          name="st2",
          align_corners=align_corners,
      )
  
      self.tr2 = TransitionLayer(
          in_channels=self.stage2_num_channels,
          out_channels=self.stage3_num_channels,
          name="tr2",
      )
      self.st3 = Stage(
          num_channels=self.stage3_num_channels,
          num_modules=self.stage3_num_modules,
          num_blocks=self.stage3_num_blocks,
          num_filters=self.stage3_num_channels,
          has_se=self.has_se,
          name="st3",
          align_corners=align_corners,
      )
  
      self.tr3 = TransitionLayer(
          in_channels=self.stage3_num_channels,
          out_channels=self.stage4_num_channels,
          name="tr3",
      )
      self.st4 = Stage(
          num_channels=self.stage4_num_channels,
          num_modules=self.stage4_num_modules,
          num_blocks=self.stage4_num_blocks,
          num_filters=self.stage4_num_channels,
          has_se=self.has_se,
          name="st4",
          align_corners=align_corners,
      )
  
imports: import math
  from typing import Tuple
  import paddle
  import paddle.nn
  import paddle.nn.functional
  import ocrnet_hrnetw18_cityscapes.layers
label_desc: Use image node_id 1 to create a new HRNet_W18 object from inherited base classes: nn with example: obj = HRNet_W18(stage1_num_modules, stage1_num_blocks, stage1_num_channels, stage2_num_modules, stage2_num_blocks, stage2_num_channels, stage3_num_modules, stage3_num_blocks, stage3_num_channels, stage4_num_modules, stage4_num_blocks, stage4_num_channels, has_se, align_corners)