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_transition_layer(
      self,
      num_channels_pre_layer,
      num_channels_cur_layer,
      freeze_norm=False,
      norm_decay=0.0,
  ):
      num_branches_pre = len(num_channels_pre_layer)
      num_branches_cur = len(num_channels_cur_layer)
      transition_layers = []
      for i in range(num_branches_cur):
          if i < num_branches_pre:
              if num_channels_cur_layer[i] != num_channels_pre_layer[i]:
                  transition_layers.append(
                      nn.Sequential(
                          L.Conv2d(
                              num_channels_pre_layer[i],
                              num_channels_pre_layer[i],
                              kernel_size=3,
                              stride=1,
                              padding=1,
                              groups=num_channels_pre_layer[i],
                              bias=False,
                          ),
                          nn.BatchNorm2D(num_channels_pre_layer[i]),
                          L.Conv2d(
                              num_channels_pre_layer[i],
                              num_channels_cur_layer[i],
                              kernel_size=1,
                              stride=1,
                              padding=0,
                              bias=False,
                          ),
                          nn.BatchNorm2D(num_channels_cur_layer[i]),
                          nn.ReLU(),
                      )
                  )
              else:
                  transition_layers.append(None)
          else:
              conv_downsamples = []
              for j in range(i + 1 - num_branches_pre):
                  conv_downsamples.append(
                      nn.Sequential(
                          L.Conv2d(
                              num_channels_pre_layer[-1],
                              num_channels_pre_layer[-1],
                              groups=num_channels_pre_layer[-1],
                              kernel_size=3,
                              stride=2,
                              padding=1,
                              bias=False,
                          ),
                          nn.BatchNorm2D(num_channels_pre_layer[-1]),
                          L.Conv2d(
                              num_channels_pre_layer[-1],
                              num_channels_cur_layer[i]
                              if j == i - num_branches_pre
                              else num_channels_pre_layer[-1],
                              kernel_size=1,
                              stride=1,
                              padding=0,
                              bias=False,
                          ),
                          nn.BatchNorm2D(
                              num_channels_cur_layer[i]
                              if j == i - num_branches_pre
                              else num_channels_pre_layer[-1]
                          ),
                          nn.ReLU(),
                      )
                  )
              transition_layers.append(nn.Sequential(*conv_downsamples))
      return nn.LayerList(transition_layers)
  
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 2 for calling the LiteHRNet obj's underlying member method code with example usage: obj._make_transition_layer(num_channels_pre_layer, num_channels_cur_layer, freeze_norm, norm_decay) and returns: nn