class_docstr: The semantic segmentation models for mobile devices.
  
  Args:
      num_classes (int): The number of target classes.
      backbone(nn.Layer): Backbone network, such as stdc1net and resnet18. The backbone must
          has feat_channels, of which the length is 5.
      backbone_indices (List(int), optional): The values indicate the indices of output of backbone.
          Default: [2, 3, 4].
      cm_bin_sizes (List(int), optional): The bin size of context module. Default: [1,2,4].
      cm_out_ch (int, optional): The output channel of the last context module. Default: 128.
      arm_type (str, optional): The type of attention refinement module. Default: ARM_Add_SpAttenAdd3.
      arm_out_chs (List(int), optional): The out channels of each arm module. Default: [64, 96, 128].
      seg_head_inter_chs (List(int), optional): The intermediate channels of segmentation head.
          Default: [64, 64, 64].
      resize_mode (str, optional): The resize mode for the upsampling operation in decoder.
          Default: bilinear.
      use_last_fuse (bool, optional): Whether use fusion in the last. Default: False.
      pretrained (str, optional): The path or url of pretrained model. Default: None.
class_docstr_tok: ["The","semantic","segmentation","models","for","mobile","devices",".","Args",":","num_classes","(","int",")",":","The","number","of","target","classes",".","backbone","(","nn.Layer",")",":","Backbone","network",",","such","as","stdc1net","and","resnet18",".","The","backbone","must","has","feat_channels",",","of","which","the","length","is","5.","backbone_indices","(","List","(","int",")",",","optional",")",":","The","values","indicate","the","indices","of","output","of","backbone",".","Default",":","[","2",",","3",",","4","]",".","cm_bin_sizes","(","List","(","int",")",",","optional",")",":","The","bin","size","of","context","module",".","Default",":","[","1,2,4","]",".","cm_out_ch","(","int",",","optional",")",":","The","output","channel","of","the","last","context","module",".","Default",":","128.","arm_type","(","str",",","optional",")",":","The","type","of","attention","refinement","module",".","Default",":","ARM_Add_SpAttenAdd3",".","arm_out_chs","(","List","(","int",")",",","optional",")",":","The","out","channels","of","each","arm","module",".","Default",":","[","64",",","96",",","128","]",".","seg_head_inter_chs","(","List","(","int",")",",","optional",")",":","The","intermediate","channels","of","segmentation","head",".","Default",":","[","64",",","64",",","64","]",".","resize_mode","(","str",",","optional",")",":","The","resize","mode","for","the","upsampling","operation","in","decoder",".","Default",":","bilinear",".","use_last_fuse","(","bool",",","optional",")",":","Whether","use","fusion","in","the","last",".","Default",":","False",".","pretrained","(","str",",","optional",")",":","The","path","or","url","of","pretrained","model",".","Default",":","None","."]
code: def __init__(
      self,
      num_classes,
      backbone,
      backbone_indices=[1, 2, 3],
      cm_bin_sizes=[1, 2],
      cm_out_ch=64,
      arm_type="UAFMMobile",
      arm_out_chs=[32, 48, 64],
      seg_head_inter_chs=[32, 32, 32],
      resize_mode="bilinear",
      use_last_fuse=False,
      pretrained=None,
  ):
      super().__init__()
  
      # backbone
      assert hasattr(
          backbone, "feat_channels"
      ), "The backbone should has feat_channels."
      assert len(backbone.feat_channels) >= len(backbone_indices), (
          f"The length of input backbone_indices ({len(backbone_indices)}) should not be"
          f"greater than the length of feat_channels ({len(backbone.feat_channels)})."
      )
      assert len(backbone.feat_channels) > max(backbone_indices), (
          f"The max value ({max(backbone_indices)}) of backbone_indices should be "
          f"less than the length of feat_channels ({len(backbone.feat_channels)})."
      )
      self.backbone = backbone
  
      assert len(backbone_indices) >= 1, (
          "The lenght of backbone_indices "
          "should not be lesser than 1"
      )
      self.backbone_indices = backbone_indices  # [..., x16_id, x32_id]
      backbone_out_chs = [
          backbone.feat_channels[i] for i in backbone_indices
      ]
  
      # head
      if len(arm_out_chs) == 1:
          arm_out_chs = arm_out_chs * len(backbone_indices)
      assert len(arm_out_chs) == len(backbone_indices), (
          "The length of "
          "arm_out_chs and backbone_indices should be equal"
      )
  
      self.ppseg_head = MobileSegHead(
          backbone_out_chs,
          arm_out_chs,
          cm_bin_sizes,
          cm_out_ch,
          arm_type,
          resize_mode,
          use_last_fuse,
      )
  
      if len(seg_head_inter_chs) == 1:
          seg_head_inter_chs = seg_head_inter_chs * len(
              backbone_indices
          )
      assert len(seg_head_inter_chs) == len(backbone_indices), (
          "The length of "
          "seg_head_inter_chs and backbone_indices should be equal"
      )
      self.seg_heads = nn.LayerList()  # [..., head_16, head32]
      for in_ch, mid_ch in zip(arm_out_chs, seg_head_inter_chs):
          self.seg_heads.append(SegHead(in_ch, mid_ch, num_classes))
  
      # pretrained
      self.pretrained = pretrained
      self.init_weight()
  
imports: import paddle
  import paddle.nn
  import paddle.nn.functional
  from paddleseg import utils
  from paddleseg.models import layers
  from paddleseg.cvlibs import manager
label_desc: Use image node_id 1 to create a new MobileSeg object from inherited base classes: nn with example: obj = MobileSeg(num_classes, backbone, backbone_indices, cm_bin_sizes, cm_out_ch, arm_type, arm_out_chs, seg_head_inter_chs, resize_mode, use_last_fuse, pretrained)