class_docstr: MaskHead of SOLOv2.
  The code of this function is based on:
      https://github.com/WXinlong/SOLO/blob/master/mmdet/models/mask_heads/mask_feat_head.py
  
  Args:
      in_channels (int): The channel number of input Tensor.
      out_channels (int): The channel number of output Tensor.
      start_level (int): The position where the input starts.
      end_level (int): The position where the input ends.
      use_dcn_in_tower (bool): Whether to use dcn in tower or not.
class_docstr_tok: ["MaskHead","of","SOLOv2",".","The","code","of","this","function","is","based","on",":","https",":","\/\/github.com\/WXinlong\/SOLO\/blob\/master\/mmdet\/models\/mask_heads\/mask_feat_head.py","Args",":","in_channels","(","int",")",":","The","channel","number","of","input","Tensor",".","out_channels","(","int",")",":","The","channel","number","of","output","Tensor",".","start_level","(","int",")",":","The","position","where","the","input","starts",".","end_level","(","int",")",":","The","position","where","the","input","ends",".","use_dcn_in_tower","(","bool",")",":","Whether","to","use","dcn","in","tower","or","not","."]
code: def __init__(
      self,
      in_channels=256,
      mid_channels=128,
      out_channels=256,
      start_level=0,
      end_level=3,
      use_dcn_in_tower=False,
      norm_type="gn",
  ):
      super(SOLOv2MaskHead, self).__init__()
      assert start_level >= 0 and end_level >= start_level
      self.in_channels = in_channels
      self.out_channels = out_channels
      self.mid_channels = mid_channels
      self.use_dcn_in_tower = use_dcn_in_tower
      self.range_level = end_level - start_level + 1
      self.use_dcn = True if self.use_dcn_in_tower else False
      self.convs_all_levels = []
      self.norm_type = norm_type
      for i in range(start_level, end_level + 1):
          conv_feat_name = "mask_feat_head.convs_all_levels.{}".format(
              i
          )
          conv_pre_feat = nn.Sequential()
          if i == start_level:
              conv_pre_feat.add_sublayer(
                  conv_feat_name + ".conv" + str(i),
                  ConvNormLayer(
                      ch_in=self.in_channels,
                      ch_out=self.mid_channels,
                      filter_size=3,
                      stride=1,
                      use_dcn=self.use_dcn,
                      norm_type=self.norm_type,
                  ),
              )
              self.add_sublayer("conv_pre_feat" + str(i), conv_pre_feat)
              self.convs_all_levels.append(conv_pre_feat)
          else:
              for j in range(i):
                  ch_in = 0
                  if j == 0:
                      ch_in = (
                          self.in_channels + 2
                          if i == end_level
                          else self.in_channels
                      )
                  else:
                      ch_in = self.mid_channels
                  conv_pre_feat.add_sublayer(
                      conv_feat_name + ".conv" + str(j),
                      ConvNormLayer(
                          ch_in=ch_in,
                          ch_out=self.mid_channels,
                          filter_size=3,
                          stride=1,
                          use_dcn=self.use_dcn,
                          norm_type=self.norm_type,
                      ),
                  )
                  conv_pre_feat.add_sublayer(
                      conv_feat_name + ".conv" + str(j) + "act",
                      nn.ReLU(),
                  )
                  conv_pre_feat.add_sublayer(
                      "upsample" + str(i) + str(j),
                      nn.Upsample(scale_factor=2, mode="bilinear"),
                  )
              self.add_sublayer("conv_pre_feat" + str(i), conv_pre_feat)
              self.convs_all_levels.append(conv_pre_feat)
  
      conv_pred_name = "mask_feat_head.conv_pred.0"
      self.conv_pred = self.add_sublayer(
          conv_pred_name,
          ConvNormLayer(
              ch_in=self.mid_channels,
              ch_out=self.out_channels,
              filter_size=1,
              stride=1,
              use_dcn=self.use_dcn,
              norm_type=self.norm_type,
          ),
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import paddle
  from paddle import ParamAttr
  import paddle.nn
  import paddle.nn.functional
  from paddle.nn.initializer import Normal, Constant
  from ppdet.modeling.layers import ConvNormLayer, MaskMatrixNMS, DropBlock
  from ppdet.core.workspace import register
  from six.moves import zip
  import numpy
label_desc: Use image node_id 1 to create a new SOLOv2MaskHead object from inherited base classes: nn with example: obj = SOLOv2MaskHead(in_channels, mid_channels, out_channels, start_level, end_level, use_dcn_in_tower, norm_type)