class_docstr: Channel Mapper to reduce/increase channels of backbone features.
  
  This is used to reduce/increase channels of backbone features.
  
  Args:
      in_channels (List[int]): Number of input channels per scale.
      out_channels (int): Number of output channels (used at each scale).
      kernel_size (int, optional): kernel_size for reducing channels (used
          at each scale). Default: 3.
      conv_cfg (dict, optional): Config dict for convolution layer.
          Default: None.
      norm_cfg (dict, optional): Config dict for normalization layer.
          Default: None.
      act_cfg (dict, optional): Config dict for activation layer in
          ConvModule. Default: dict(type='ReLU').
      num_outs (int, optional): Number of output feature maps. There
          would be extra_convs when num_outs larger than the length
          of in_channels.
      init_cfg (dict or list[dict], optional): Initialization config dict.
      
class_docstr_tok: ["Channel","Mapper","to","reduce\/increase","channels","of","backbone","features",".","This","is","used","to","reduce\/increase","channels","of","backbone","features",".","Args",":","in_channels","(","List","[","int","]",")",":","Number","of","input","channels","per","scale",".","out_channels","(","int",")",":","Number","of","output","channels","(","used","at","each","scale",")",".","kernel_size","(","int",",","optional",")",":","kernel_size","for","reducing","channels","(","used","at","each","scale",")",".","Default",":","3.","conv_cfg","(","dict",",","optional",")",":","Config","dict","for","convolution","layer",".","Default",":","None",".","norm_cfg","(","dict",",","optional",")",":","Config","dict","for","normalization","layer",".","Default",":","None",".","act_cfg","(","dict",",","optional",")",":","Config","dict","for","activation","layer","in","ConvModule",".","Default",":","dict","(","type='ReLU","'",")",".","num_outs","(","int",",","optional",")",":","Number","of","output","feature","maps",".","There","would","be","extra_convs","when","num_outs","larger","than","the","length","of","in_channels",".","init_cfg","(","dict","or","list","[","dict","]",",","optional",")",":","Initialization","config","dict","."]
code: def __init__(
      self,
      in_channels,
      out_channels,
      kernel_size=3,
      norm_type="gn",
      norm_groups=32,
      act="relu",
      num_outs=None,
      init_cfg=dict(
          type="Xavier", layer="Conv2d", distribution="uniform"
      ),
  ):
      super(ChannelMapper, self).__init__()
      assert isinstance(in_channels, list)
      self.extra_convs = None
      if num_outs is None:
          num_outs = len(in_channels)
      self.convs = nn.LayerList()
      for in_channel in in_channels:
          self.convs.append(
              ConvNormLayer(
                  ch_in=in_channel,
                  ch_out=out_channels,
                  filter_size=kernel_size,
                  norm_type="gn",
                  norm_groups=32,
                  act=act,
              )
          )
  
      if num_outs > len(in_channels):
          self.extra_convs = nn.LayerList()
          for i in range(len(in_channels), num_outs):
              if i == len(in_channels):
                  in_channel = in_channels[-1]
              else:
                  in_channel = out_channels
              self.extra_convs.append(
                  ConvNormLayer(
                      ch_in=in_channel,
                      ch_out=out_channels,
                      filter_size=3,
                      stride=2,
                      norm_type="gn",
                      norm_groups=32,
                      act=act,
                  )
              )
      self.init_weights()
  
file_path: PaddleDetection/ppdet/modeling/necks/channel_mapper.py
imports: import paddle.nn
  from ppdet.core.workspace import register, serializable
  from ..backbones.hrnet import ConvNormLayer
  from ..shape_spec import ShapeSpec
  from ..initializer import xavier_uniform_, constant_
label_desc: Use image node_id 1 to create a new ChannelMapper object from inherited base classes: nn with example: obj = ChannelMapper(in_channels, out_channels, kernel_size, norm_type, norm_groups, act, num_outs, init_cfg)