class_docstr: The SeaFormer implementation based on PaddlePaddle.
  
  The original article refers to
  Qiang Wan, et, al. "SEAFORMER: SQUEEZE-ENHANCED AXIAL TRANSFORMER FOR MOBILE SEMANTIC SEGMENTATION"
  (https://arxiv.org/pdf/2301.13156.pdf).
  
  Args:
      in_channels (int, optional): The channels of input image. Default: 3.
      cfg (list[list], optional): Two values in the tuple indicate the indices of output of backbone. Defaulte: 
                    [[[3, 1, 16, 1], [3, 4, 32, 2], [3, 3, 32, 1]],
                     [[5, 3, 64, 2], [5, 3, 64, 1]],
                     [[3, 3, 128, 2], [3, 3, 128, 1]], 
                     [[5, 4, 192, 2]],
                     [[3, 6, 256, 2]]]
      channels (list[int], optional): Number of channels hidden layer. Default: [16, 32, 64, 128, 192, 256].
      embed_dims (list, optional): The size of embedding dimensions. Default: [192, 256].
      key_dims (list[int], optional): The unique number of key dimension. Default: [16, 24].
      depths (list[int], optional): The depth of every layer. Default: [4, 4].
      num_heads (int, optional): The number of heads for evary layer. Default: 8.
      attn_ratios (int, optional): Argument of expansion ratio of BasicLayer. Default: 2.
      mlp_ratios (list[int], optional): Argument of expansion ratio of MlP layers. Default: [2, 4].
      drop_path_ratio (int, optional): Argument of drop path ratio. Default: 0.1.
      act_layer (nn.Layer, optional): Activation function for model. Default: nn.ReLU6.
      pretrained (str, optional): The path or url of pretrained model. Default: None.
class_docstr_tok: ["The","SeaFormer","implementation","based","on","PaddlePaddle",".","The","original","article","refers","to","Qiang","Wan",",","et",",","al",".","``","SEAFORMER",":","SQUEEZE-ENHANCED","AXIAL","TRANSFORMER","FOR","MOBILE","SEMANTIC","SEGMENTATION","''","(","https",":","\/\/arxiv.org\/pdf\/2301.13156.pdf",")",".","Args",":","in_channels","(","int",",","optional",")",":","The","channels","of","input","image",".","Default",":","3.","cfg","(","list","[","list","]",",","optional",")",":","Two","values","in","the","tuple","indicate","the","indices","of","output","of","backbone",".","Defaulte",":","[","[","[","3",",","1",",","16",",","1","]",",","[","3",",","4",",","32",",","2","]",",","[","3",",","3",",","32",",","1","]","]",",","[","[","5",",","3",",","64",",","2","]",",","[","5",",","3",",","64",",","1","]","]",",","[","[","3",",","3",",","128",",","2","]",",","[","3",",","3",",","128",",","1","]","]",",","[","[","5",",","4",",","192",",","2","]","]",",","[","[","3",",","6",",","256",",","2","]","]","]","channels","(","list","[","int","]",",","optional",")",":","Number","of","channels","hidden","layer",".","Default",":","[","16",",","32",",","64",",","128",",","192",",","256","]",".","embed_dims","(","list",",","optional",")",":","The","size","of","embedding","dimensions",".","Default",":","[","192",",","256","]",".","key_dims","(","list","[","int","]",",","optional",")",":","The","unique","number","of","key","dimension",".","Default",":","[","16",",","24","]",".","depths","(","list","[","int","]",",","optional",")",":","The","depth","of","every","layer",".","Default",":","[","4",",","4","]",".","num_heads","(","int",",","optional",")",":","The","number","of","heads","for","evary","layer",".","Default",":","8.","attn_ratios","(","int",",","optional",")",":","Argument","of","expansion","ratio","of","BasicLayer",".","Default",":","2.","mlp_ratios","(","list","[","int","]",",","optional",")",":","Argument","of","expansion","ratio","of","MlP","layers",".","Default",":","[","2",",","4","]",".","drop_path_ratio","(","int",",","optional",")",":","Argument","of","drop","path","ratio",".","Default",":","0.1.","act_layer","(","nn.Layer",",","optional",")",":","Activation","function","for","model",".","Default",":","nn.ReLU6",".","pretrained","(","str",",","optional",")",":","The","path","or","url","of","pretrained","model",".","Default",":","None","."]
code: def __init__(
      self,
      in_channels=3,
      cfgs=[
          [[3, 1, 16, 1], [3, 4, 32, 2], [3, 3, 32, 1]],
          [[5, 3, 64, 2], [5, 3, 64, 1]],
          [[3, 3, 128, 2], [3, 3, 128, 1]],
          [[5, 4, 192, 2]],
          [[3, 6, 256, 2]],
      ],
      channels=[16, 32, 64, 128, 192, 256],
      emb_dims=[192, 256],
      key_dims=[16, 24],
      depths=[4, 4],
      num_heads=8,
      attn_ratios=2,
      mlp_ratios=[2, 4],
      drop_path_rate=0.1,
      act_layer=nn.ReLU6,
      pretrained=None,
  ):
      super().__init__()
  
      self.channels = channels
      self.depths = depths
      self.cfgs = cfgs
      self.pretrained = pretrained
  
      for i in range(len(cfgs)):
          smb = StackedMV2Block(
              in_channels=in_channels,
              cfgs=cfgs[i],
              stem=True if i == 0 else False,
              inp_channel=channels[i],
          )
          setattr(self, f"smb{i + 1}", smb)
  
      for i in range(len(depths)):
          dpr = [
              x.item()
              for x in paddle.linspace(0, drop_path_rate, depths[i])
          ]  # stochastic depth decay rule
          trans = BasicLayer(
              block_num=depths[i],
              embedding_dim=emb_dims[i],
              key_dim=key_dims[i],
              num_heads=num_heads,
              mlp_ratio=mlp_ratios[i],
              attn_ratio=attn_ratios,
              drop=0,
              attn_drop=0,
              drop_path=dpr,
              act_layer=act_layer,
          )
          setattr(self, f"trans{i + 1}", trans)
  
      self.init_weights()
  
imports: import paddle
  import paddle.nn
  import paddle.nn.functional
  from paddleseg.cvlibs import manager, param_init
  from paddleseg.models import layers
  from paddleseg.models.backbones.transformer_utils import DropPath, zeros_, ones_
  from paddleseg.utils import utils
label_desc: Use image node_id 1 to create a new SeaFormer object from inherited base classes: nn with example: obj = SeaFormer(in_channels, cfgs, channels, emb_dims, key_dims, depths, num_heads, attn_ratios, mlp_ratios, drop_path_rate, act_layer, pretrained)