class_docstr: @inproceedings{Yulitehrnet21,
  title={Lite-HRNet: A Lightweight High-Resolution Network},
      author={Yu, Changqian and Xiao, Bin and Gao, Changxin and Yuan, Lu and Zhang, Lei and Sang, Nong and Wang, Jingdong},
      booktitle={CVPR},year={2021}
  }
  Args:
      network_type (str): the network_type should be one of ["lite_18", "lite_30", "naive", "wider_naive"],
          "naive": Simply combining the shuffle block in ShuffleNet and the highresolution design pattern in HRNet.
          "wider_naive": Naive network with wider channels in each block.
          "lite_18": Lite-HRNet-18, which replaces the pointwise convolution in a shuffle block by conditional channel weighting.
          "lite_30": Lite-HRNet-30, with more blocks compared with Lite-HRNet-18.
      freeze_at (int): the stage to freeze
      freeze_norm (bool): whether to freeze norm in HRNet
      norm_decay (float): weight decay for normalization layer weights
      return_idx (List): the stage to return
class_docstr_tok: ["@","inproceedings","{","Yulitehrnet21",",","title=","{","Lite-HRNet",":","A","Lightweight","High-Resolution","Network","}",",","author=","{","Yu",",","Changqian","and","Xiao",",","Bin","and","Gao",",","Changxin","and","Yuan",",","Lu","and","Zhang",",","Lei","and","Sang",",","Nong","and","Wang",",","Jingdong","}",",","booktitle=","{","CVPR","}",",","year=","{","2021","}","}","Args",":","network_type","(","str",")",":","the","network_type","should","be","one","of","[","``","lite_18","''",",","``","lite_30","''",",","``","naive","''",",","``","wider_naive","''","]",",","``","naive","''",":","Simply","combining","the","shuffle","block","in","ShuffleNet","and","the","highresolution","design","pattern","in","HRNet",".","``","wider_naive","''",":","Naive","network","with","wider","channels","in","each","block",".","``","lite_18","''",":","Lite-HRNet-18",",","which","replaces","the","pointwise","convolution","in","a","shuffle","block","by","conditional","channel","weighting",".","``","lite_30","''",":","Lite-HRNet-30",",","with","more","blocks","compared","with","Lite-HRNet-18",".","freeze_at","(","int",")",":","the","stage","to","freeze","freeze_norm","(","bool",")",":","whether","to","freeze","norm","in","HRNet","norm_decay","(","float",")",":","weight","decay","for","normalization","layer","weights","return_idx","(","List",")",":","the","stage","to","return"]
code: def _make_stage(
      self,
      stages_config,
      stage_idx,
      in_channels,
      multiscale_output,
      freeze_norm=False,
      norm_decay=0.0,
  ):
      num_modules = stages_config["num_modules"][stage_idx]
      num_branches = stages_config["num_branches"][stage_idx]
      num_blocks = stages_config["num_blocks"][stage_idx]
      reduce_ratio = stages_config["reduce_ratios"][stage_idx]
      module_type = stages_config["module_type"][stage_idx]
  
      modules = []
      for i in range(num_modules):
          if not multiscale_output and i == num_modules - 1:
              reset_multiscale_output = False
          else:
              reset_multiscale_output = True
          modules.append(
              LiteHRNetModule(
                  num_branches,
                  num_blocks,
                  in_channels,
                  reduce_ratio,
                  module_type,
                  multiscale_output=reset_multiscale_output,
                  with_fuse=True,
                  freeze_norm=freeze_norm,
                  norm_decay=norm_decay,
              )
          )
          in_channels = modules[-1].in_channels
      return nn.Sequential(*modules), in_channels
  
imports: import paddle
  import paddle.nn
  import paddle.nn.functional
  from numbers import Integral
  from paddle import ParamAttr
  from paddle.regularizer import L2Decay
  from paddle.nn.initializer import Normal, Constant
  from ppdet.core.workspace import register
  from ppdet.modeling.shape_spec import ShapeSpec
  from ppdet.modeling.ops import channel_shuffle
  from ..None import layers
label_desc: Use image node_id 3 for calling the LiteHRNet obj's underlying member method code with example usage: obj._make_stage(stages_config, stage_idx, in_channels, multiscale_output, freeze_norm, norm_decay) and returns: nn,  in_channels