class_docstr: The UHRNet implementation based on PaddlePaddle.
  
  The original article refers to
  Jian Wang, et, al. "U-HRNet: Delving into Improving Semantic Representation of High Resolution Network for Dense Prediction"
  (https://arxiv.org/pdf/2210.07140.pdf).
  
  Args:
      in_channels (int, optional): The channels of input image. Default: 3.
      pretrained (str): The path of pretrained model.
      stage1_num_modules (int): Number of modules for stage1. Default 1.
      stage1_num_blocks (list): Number of blocks per module for stage1. Default [4].
      stage1_num_channels (list): Number of channels per branch for stage1. Default [64].
      stage2_num_modules (int): Number of modules for stage2. Default 1.
      stage2_num_blocks (list): Number of blocks per module for stage2. Default [4, 4]
      stage2_num_channels (list): Number of channels per branch for stage2. Default [18, 36].
      stage3_num_modules (int): Number of modules for stage3. Default 5.
      stage3_num_blocks (list): Number of blocks per module for stage3. Default [4, 4]
      stage3_num_channels (list): Number of channels per branch for stage3. Default [36, 72].
      stage4_num_modules (int): Number of modules for stage4. Default 2.
      stage4_num_blocks (list): Number of blocks per module for stage4. Default [4, 4]
      stage4_num_channels (list): Number of channels per branch for stage4. Default [72. 144].
      stage5_num_modules (int): Number of modules for stage5. Default 2.
      stage5_num_blocks (list): Number of blocks per module for stage5. Default [4, 4]
      stage5_num_channels (list): Number of channels per branch for stage5. Default [144, 288].
      stage6_num_modules (int): Number of modules for stage6. Default 1.
      stage6_num_blocks (list): Number of blocks per module for stage6. Default [4, 4]
      stage6_num_channels (list): Number of channels per branch for stage6. Default [72. 144].
      stage7_num_modules (int): Number of modules for stage7. Default 1.
      stage7_num_blocks (list): Number of blocks per module for stage7. Default [4, 4]
      stage7_num_channels (list): Number of channels per branch for stage7. Default [36, 72].
      stage8_num_modules (int): Number of modules for stage8. Default 1.
      stage8_num_blocks (list): Number of blocks per module for stage8. Default [4, 4]
      stage8_num_channels (list): Number of channels per branch for stage8. Default [18, 36].
      stage9_num_modules (int): Number of modules for stage9. Default 1.
      stage9_num_blocks (list): Number of blocks per module for stage9. Default [4]
      stage9_num_channels (list): Number of channels per branch for stage9. Default [18].
      has_se (bool): 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","UHRNet","implementation","based","on","PaddlePaddle",".","The","original","article","refers","to","Jian","Wang",",","et",",","al",".","``","U-HRNet",":","Delving","into","Improving","Semantic","Representation","of","High","Resolution","Network","for","Dense","Prediction","''","(","https",":","\/\/arxiv.org\/pdf\/2210.07140.pdf",")",".","Args",":","in_channels","(","int",",","optional",")",":","The","channels","of","input","image",".","Default",":","3.","pretrained","(","str",")",":","The","path","of","pretrained","model",".","stage1_num_modules","(","int",")",":","Number","of","modules","for","stage1",".","Default","1.","stage1_num_blocks","(","list",")",":","Number","of","blocks","per","module","for","stage1",".","Default","[","4","]",".","stage1_num_channels","(","list",")",":","Number","of","channels","per","branch","for","stage1",".","Default","[","64","]",".","stage2_num_modules","(","int",")",":","Number","of","modules","for","stage2",".","Default","1.","stage2_num_blocks","(","list",")",":","Number","of","blocks","per","module","for","stage2",".","Default","[","4",",","4","]","stage2_num_channels","(","list",")",":","Number","of","channels","per","branch","for","stage2",".","Default","[","18",",","36","]",".","stage3_num_modules","(","int",")",":","Number","of","modules","for","stage3",".","Default","5.","stage3_num_blocks","(","list",")",":","Number","of","blocks","per","module","for","stage3",".","Default","[","4",",","4","]","stage3_num_channels","(","list",")",":","Number","of","channels","per","branch","for","stage3",".","Default","[","36",",","72","]",".","stage4_num_modules","(","int",")",":","Number","of","modules","for","stage4",".","Default","2.","stage4_num_blocks","(","list",")",":","Number","of","blocks","per","module","for","stage4",".","Default","[","4",",","4","]","stage4_num_channels","(","list",")",":","Number","of","channels","per","branch","for","stage4",".","Default","[","72",".","144","]",".","stage5_num_modules","(","int",")",":","Number","of","modules","for","stage5",".","Default","2.","stage5_num_blocks","(","list",")",":","Number","of","blocks","per","module","for","stage5",".","Default","[","4",",","4","]","stage5_num_channels","(","list",")",":","Number","of","channels","per","branch","for","stage5",".","Default","[","144",",","288","]",".","stage6_num_modules","(","int",")",":","Number","of","modules","for","stage6",".","Default","1.","stage6_num_blocks","(","list",")",":","Number","of","blocks","per","module","for","stage6",".","Default","[","4",",","4","]","stage6_num_channels","(","list",")",":","Number","of","channels","per","branch","for","stage6",".","Default","[","72",".","144","]",".","stage7_num_modules","(","int",")",":","Number","of","modules","for","stage7",".","Default","1.","stage7_num_blocks","(","list",")",":","Number","of","blocks","per","module","for","stage7",".","Default","[","4",",","4","]","stage7_num_channels","(","list",")",":","Number","of","channels","per","branch","for","stage7",".","Default","[","36",",","72","]",".","stage8_num_modules","(","int",")",":","Number","of","modules","for","stage8",".","Default","1.","stage8_num_blocks","(","list",")",":","Number","of","blocks","per","module","for","stage8",".","Default","[","4",",","4","]","stage8_num_channels","(","list",")",":","Number","of","channels","per","branch","for","stage8",".","Default","[","18",",","36","]",".","stage9_num_modules","(","int",")",":","Number","of","modules","for","stage9",".","Default","1.","stage9_num_blocks","(","list",")",":","Number","of","blocks","per","module","for","stage9",".","Default","[","4","]","stage9_num_channels","(","list",")",":","Number","of","channels","per","branch","for","stage9",".","Default","[","18","]",".","has_se","(","bool",")",":","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_weight(self):
      for layer in self.sublayers():
          if isinstance(layer, nn.Conv2D):
              param_init.normal_init(layer.weight, std=0.001)
          elif isinstance(layer, (nn.BatchNorm, nn.SyncBatchNorm)):
              param_init.constant_init(layer.weight, value=1.0)
              param_init.constant_init(layer.bias, value=0.0)
      if self.pretrained is not None:
          utils.load_pretrained_model(self, self.pretrained)
  
imports: import math
  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
label_desc: Use image node_id 4 for calling the UHRNet obj's underlying member method code with example usage: obj.init_weight() without return types