class_docstr: The SwinTransformer implementation based on PaddlePaddle.
  
  The original article refers to
  Liu, Ze, et al. "Swin Transformer: Hierarchical Vision Transformer using Shifted Windows"
  (https://arxiv.org/abs/2103.14030)
  
  Args:
      pretrain_img_size (int): Input image size for training the pretrained model, used in absolute postion embedding. Default: 224.
      patch_size (int | tuple(int)): Patch size. Default: 4.
      in_channels (int): Number of input image channels. Default: 3.
      embed_dim (int): Number of linear projection output channels. Default: 96.
      depths (tuple[int]): Depths of each Swin Transformer stage.
      num_heads (tuple[int]): Number of attention head of each stage.
      window_size (int): Window size. Default: 7.
      mlp_ratio (float): Ratio of mlp hidden dim to embedding dim. Default: 4.
      qkv_bias (bool): If True, add a learnable bias to query, key, value. Default: True
      qk_scale (float): Override default qk scale of head_dim ** -0.5 if set.
      drop_rate (float): Dropout rate.
      attn_drop_rate (float): Attention dropout rate. Default: 0.
      drop_path_rate (float): Stochastic depth rate. Default: 0.2.
      norm_layer (nn.Layer): Normalization layer. Default: nn.LayerNorm.
      ape (bool): If True, add absolute position embedding to the patch embedding. Default: False.
      patch_norm (bool): If True, add normalization after patch embedding. Default: True.
      out_indices (Sequence[int]): Output from which stages.
      frozen_stages (int): Stages to be frozen (stop grad and set eval mode). -1 means not freezing any parameters. Default: -1.
      pretrained (str, optional): The path or url of pretrained model. Default: None.
class_docstr_tok: ["The","SwinTransformer","implementation","based","on","PaddlePaddle",".","The","original","article","refers","to","Liu",",","Ze",",","et","al",".","``","Swin","Transformer",":","Hierarchical","Vision","Transformer","using","Shifted","Windows","''","(","https",":","\/\/arxiv.org\/abs\/2103.14030",")","Args",":","pretrain_img_size","(","int",")",":","Input","image","size","for","training","the","pretrained","model",",","used","in","absolute","postion","embedding",".","Default",":","224.","patch_size","(","int","|","tuple","(","int",")",")",":","Patch","size",".","Default",":","4.","in_channels","(","int",")",":","Number","of","input","image","channels",".","Default",":","3.","embed_dim","(","int",")",":","Number","of","linear","projection","output","channels",".","Default",":","96.","depths","(","tuple","[","int","]",")",":","Depths","of","each","Swin","Transformer","stage",".","num_heads","(","tuple","[","int","]",")",":","Number","of","attention","head","of","each","stage",".","window_size","(","int",")",":","Window","size",".","Default",":","7.","mlp_ratio","(","float",")",":","Ratio","of","mlp","hidden","dim","to","embedding","dim",".","Default",":","4.","qkv_bias","(","bool",")",":","If","True",",","add","a","learnable","bias","to","query",",","key",",","value",".","Default",":","True","qk_scale","(","float",")",":","Override","default","qk","scale","of","head_dim","*","*","-0.5","if","set",".","drop_rate","(","float",")",":","Dropout","rate",".","attn_drop_rate","(","float",")",":","Attention","dropout","rate",".","Default",":","0.","drop_path_rate","(","float",")",":","Stochastic","depth","rate",".","Default",":","0.2.","norm_layer","(","nn.Layer",")",":","Normalization","layer",".","Default",":","nn.LayerNorm",".","ape","(","bool",")",":","If","True",",","add","absolute","position","embedding","to","the","patch","embedding",".","Default",":","False",".","patch_norm","(","bool",")",":","If","True",",","add","normalization","after","patch","embedding",".","Default",":","True",".","out_indices","(","Sequence","[","int","]",")",":","Output","from","which","stages",".","frozen_stages","(","int",")",":","Stages","to","be","frozen","(","stop","grad","and","set","eval","mode",")",".","-1","means","not","freezing","any","parameters",".","Default",":","-1.","pretrained","(","str",",","optional",")",":","The","path","or","url","of","pretrained","model",".","Default",":","None","."]
docstr: Convert the model into training mode while keep layers freezed.
docstr_tok: ["Convert","the","model","into","training","mode","while","keep","layers","freezed","."]
code: def train(self):
      """Convert the model into training mode while keep layers freezed."""
      super(SwinTransformer, self).train()
      self._freeze_stages()
  
imports: import paddle
  import paddle.nn
  import paddle.nn.functional
  import numpy
  from paddleseg.cvlibs import manager
  from paddleseg.utils import utils
  from paddleseg.models.backbones.transformer_utils import *
label_desc: Use image node_id 5 for calling the SwinTransformer obj's underlying member method code with example usage: obj.train() without return types