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_weights(self, pretrained=None):
      if pretrained is not None:
          utils.load_pretrained_model(self, pretrained)
      else:
          for sublayer in self.sublayers():
              if isinstance(sublayer, nn.LayerNorm):
                  zeros_(sublayer.bias)
                  ones_(sublayer.weight)
              elif isinstance(sublayer, nn.Conv2D):
                  fan_out = (
                      sublayer._kernel_size[0]
                      * sublayer._kernel_size[1]
                      * sublayer._out_channels
                  )
                  fan_out //= sublayer._groups
                  initializer = Normal(
                      mean=0, std=math.sqrt(2.0 / fan_out)
                  )
                  initializer(sublayer.weight)
                  zeros_(sublayer.bias)
  
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 2 for calling the MSCAN obj's underlying member method code with example usage: obj.init_weights(pretrained) without return types