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_weights(self):
      for layer in self.sublayers():
          if isinstance(layer, nn.Conv2D):
              std = (
                  layer._kernel_size[0]
                  * layer._kernel_size[1]
                  * layer._out_channels
              )
              std //= layer._groups
              param_init.normal_init(layer.weight, std=std)
          elif isinstance(layer, (nn.BatchNorm, nn.SyncBatchNorm)):
              param_init.constant_init(layer.weight, value=1.0)
              param_init.constant_init(layer.bias, value=0.0)
          elif isinstance(layer, nn.Linear):
              param_init.normal_init(layer.weight, std=0.01)
              if layer.bias is not None:
                  zeros_(layer.bias)
          elif isinstance(layer, nn.LayerNorm):
              zeros_(layer.bias)
              ones_(layer.weight)
  
      if self.pretrained is not None:
          utils.load_pretrained_model(self, self.pretrained)
  
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 3 for calling the SeaFormer obj's underlying member method code with example usage: obj.init_weights() without return types