class_docstr: The MSCAN implementation based on PaddlePaddle.
  
  The original article refers to
  Guo, Meng-Hao, et al. "SegNeXt: Rethinking Convolutional Attention Design for Semantic Segmentation"
  (https://arxiv.org/pdf/2209.08575.pdf)
  
  Args:
      in_channels (int, optional): Number of input image channels. Default: 3.
      embed_dims (list[int], optional): Number of each stage output channels. Default: [32, 64, 160, 256].
      depths (list[int], optional): Depths of each MSCAN stage.
      atten_kernel_sizes (list[int], optional): The height or width of each strip convolution kernel in attention module.
          Default: [7, 11, 21].
      mlp_ratio (float, optional): Ratio of mlp hidden dim to embedding dim. Default: 4.
      drop_rate (float, optional): Dropout rate. Default: 0.0.
      drop_path_rate (float, optional): Stochastic depth rate. Default: 0.1.
      pretrained (str, optional): The path or url of pretrained model. Default: None.
class_docstr_tok: ["The","MSCAN","implementation","based","on","PaddlePaddle",".","The","original","article","refers","to","Guo",",","Meng-Hao",",","et","al",".","``","SegNeXt",":","Rethinking","Convolutional","Attention","Design","for","Semantic","Segmentation","''","(","https",":","\/\/arxiv.org\/pdf\/2209.08575.pdf",")","Args",":","in_channels","(","int",",","optional",")",":","Number","of","input","image","channels",".","Default",":","3.","embed_dims","(","list","[","int","]",",","optional",")",":","Number","of","each","stage","output","channels",".","Default",":","[","32",",","64",",","160",",","256","]",".","depths","(","list","[","int","]",",","optional",")",":","Depths","of","each","MSCAN","stage",".","atten_kernel_sizes","(","list","[","int","]",",","optional",")",":","The","height","or","width","of","each","strip","convolution","kernel","in","attention","module",".","Default",":","[","7",",","11",",","21","]",".","mlp_ratio","(","float",",","optional",")",":","Ratio","of","mlp","hidden","dim","to","embedding","dim",".","Default",":","4.","drop_rate","(","float",",","optional",")",":","Dropout","rate",".","Default",":","0.0.","drop_path_rate","(","float",",","optional",")",":","Stochastic","depth","rate",".","Default",":","0.1.","pretrained","(","str",",","optional",")",":","The","path","or","url","of","pretrained","model",".","Default",":","None","."]
code: def __init__(
      self,
      in_channels=3,
      embed_dims=[32, 64, 160, 256],
      depths=[3, 3, 5, 2],
      mlp_ratios=[8, 8, 4, 4],
      atten_kernel_sizes=[7, 11, 21],
      drop_rate=0.0,
      drop_path_rate=0.1,
      pretrained=None,
  ):
      super().__init__()
      if not _check_length(embed_dims, mlp_ratios, depths):
          raise ValueError(
              "The length of aurgments 'embed_dims', 'mlp_ratios' and 'drop_path_rate' must be same."
          )
  
      self.depths = depths
      self.num_stages = len(embed_dims)
      self.feat_channels = embed_dims
  
      drop_path_rates = [
          x for x in np.linspace(0, drop_path_rate, sum(depths))
      ]  # stochastic depth decay rule
      cur = 0
  
      for i in range(self.num_stages):
          if i == 0:
              patch_embed = StemConv(in_channels, embed_dims[0])
          else:
              patch_embed = OverlapPatchEmbed(
                  patch_size=3,
                  stride=2,
                  in_chans=embed_dims[i - 1],
                  embed_dim=embed_dims[i],
              )
  
          block = nn.LayerList(
              [
                  Block(
                      dim=embed_dims[i],
                      atten_kernel_sizes=atten_kernel_sizes,
                      mlp_ratio=mlp_ratios[i],
                      drop=drop_rate,
                      drop_path=drop_path_rates[cur + j],
                  )
                  for j in range(depths[i])
              ]
          )
          norm = nn.LayerNorm(embed_dims[i])
          cur += depths[i]
  
          setattr(self, f"patch_embed{i + 1}", patch_embed)
          setattr(self, f"block{i + 1}", block)
          setattr(self, f"norm{i + 1}", norm)
  
      self.init_weights(pretrained)
  
imports: import math
  import numpy
  import paddle
  import paddle.nn
  from paddle.nn import Conv2D
  from paddle.nn.initializer import Assign, Normal
  from paddleseg.cvlibs import manager
  from paddleseg.models.backbones.transformer_utils import DropPath, ones_, to_2tuple, zeros_
  from paddleseg.models.layers import SyncBatchNorm
  from paddleseg.utils import utils
label_desc: Use image node_id 1 to create a new MSCAN object from inherited base classes: nn with example: obj = MSCAN(in_channels, embed_dims, depths, mlp_ratios, atten_kernel_sizes, drop_rate, drop_path_rate, pretrained)