class_docstr: UNet backbone.
  U-Net: Convolutional Networks for Biomedical Image Segmentation.
  https://arxiv.org/pdf/1505.04597.pdf
  
  Args:
      in_channels (int): Number of input image channels. Default" 3.
      base_channels (int): Number of base channels of each stage.
          The output channels of the first stage. Default: 64.
      num_stages (int): Number of stages in encoder, normally 5. Default: 5.
      strides (Sequence[int 1 | 2]): Strides of each stage in encoder.
          len(strides) is equal to num_stages. Normally the stride of the
          first stage in encoder is 1. If strides[i]=2, it uses stride
          convolution to downsample in the correspondence encoder stage.
          Default: (1, 1, 1, 1, 1).
      enc_num_convs (Sequence[int]): Number of convolutional layers in the
          convolution block of the correspondence encoder stage.
          Default: (2, 2, 2, 2, 2).
      dec_num_convs (Sequence[int]): Number of convolutional layers in the
          convolution block of the correspondence decoder stage.
          Default: (2, 2, 2, 2).
      downsamples (Sequence[int]): Whether use MaxPool to downsample the
          feature map after the first stage of encoder
          (stages: [1, num_stages)). If the correspondence encoder stage use
          stride convolution (strides[i]=2), it will never use MaxPool to
          downsample, even downsamples[i-1]=True.
          Default: (True, True, True, True).
      enc_dilations (Sequence[int]): Dilation rate of each stage in encoder.
          Default: (1, 1, 1, 1, 1).
      dec_dilations (Sequence[int]): Dilation rate of each stage in decoder.
          Default: (1, 1, 1, 1).
      with_cp (bool): Use checkpoint or not. Using checkpoint will save some
          memory while slowing down the training speed. Default: False.
      conv_cfg (dict | None): Config dict for convolution layer.
          Default: None.
      norm_cfg (dict | None): Config dict for normalization layer.
          Default: dict(type='BN').
      act_cfg (dict | None): Config dict for activation layer in ConvModule.
          Default: dict(type='ReLU').
      upsample_cfg (dict): The upsample config of the upsample module in
          decoder. Default: dict(type='InterpConv').
      norm_eval (bool): Whether to set norm layers to eval mode, namely,
          freeze running stats (mean and var). Note: Effect on Batch Norm
          and its variants only. Default: False.
      dcn (bool): Use deformable convolution in convolutional layer or not.
          Default: None.
      plugins (dict): plugins for convolutional layers. Default: None.
  
  Notice:
      The input image size should be divisible by the whole downsample rate
      of the encoder. More detail of the whole downsample rate can be found
      in UNet._check_input_divisible.
class_docstr_tok: ["UNet","backbone",".","U-Net",":","Convolutional","Networks","for","Biomedical","Image","Segmentation",".","https",":","\/\/arxiv.org\/pdf\/1505.04597.pdf","Args",":","in_channels","(","int",")",":","Number","of","input","image","channels",".","Default","''","3.","base_channels","(","int",")",":","Number","of","base","channels","of","each","stage",".","The","output","channels","of","the","first","stage",".","Default",":","64.","num_stages","(","int",")",":","Number","of","stages","in","encoder",",","normally","5",".","Default",":","5.","strides","(","Sequence","[","int","1","|","2","]",")",":","Strides","of","each","stage","in","encoder",".","len","(","strides",")","is","equal","to","num_stages",".","Normally","the","stride","of","the","first","stage","in","encoder","is","1",".","If","strides","[","i","]","=2",",","it","uses","stride","convolution","to","downsample","in","the","correspondence","encoder","stage",".","Default",":","(","1",",","1",",","1",",","1",",","1",")",".","enc_num_convs","(","Sequence","[","int","]",")",":","Number","of","convolutional","layers","in","the","convolution","block","of","the","correspondence","encoder","stage",".","Default",":","(","2",",","2",",","2",",","2",",","2",")",".","dec_num_convs","(","Sequence","[","int","]",")",":","Number","of","convolutional","layers","in","the","convolution","block","of","the","correspondence","decoder","stage",".","Default",":","(","2",",","2",",","2",",","2",")",".","downsamples","(","Sequence","[","int","]",")",":","Whether","use","MaxPool","to","downsample","the","feature","map","after","the","first","stage","of","encoder","(","stages",":","[","1",",","num_stages",")",")",".","If","the","correspondence","encoder","stage","use","stride","convolution","(","strides","[","i","]","=2",")",",","it","will","never","use","MaxPool","to","downsample",",","even","downsamples","[","i-1","]","=True",".","Default",":","(","True",",","True",",","True",",","True",")",".","enc_dilations","(","Sequence","[","int","]",")",":","Dilation","rate","of","each","stage","in","encoder",".","Default",":","(","1",",","1",",","1",",","1",",","1",")",".","dec_dilations","(","Sequence","[","int","]",")",":","Dilation","rate","of","each","stage","in","decoder",".","Default",":","(","1",",","1",",","1",",","1",")",".","with_cp","(","bool",")",":","Use","checkpoint","or","not",".","Using","checkpoint","will","save","some","memory","while","slowing","down","the","training","speed",".","Default",":","False",".","conv_cfg","(","dict","|","None",")",":","Config","dict","for","convolution","layer",".","Default",":","None",".","norm_cfg","(","dict","|","None",")",":","Config","dict","for","normalization","layer",".","Default",":","dict","(","type='BN","'",")",".","act_cfg","(","dict","|","None",")",":","Config","dict","for","activation","layer","in","ConvModule",".","Default",":","dict","(","type='ReLU","'",")",".","upsample_cfg","(","dict",")",":","The","upsample","config","of","the","upsample","module","in","decoder",".","Default",":","dict","(","type='InterpConv","'",")",".","norm_eval","(","bool",")",":","Whether","to","set","norm","layers","to","eval","mode",",","namely",",","freeze","running","stats","(","mean","and","var",")",".","Note",":","Effect","on","Batch","Norm","and","its","variants","only",".","Default",":","False",".","dcn","(","bool",")",":","Use","deformable","convolution","in","convolutional","layer","or","not",".","Default",":","None",".","plugins","(","dict",")",":","plugins","for","convolutional","layers",".","Default",":","None",".","Notice",":","The","input","image","size","should","be","divisible","by","the","whole","downsample","rate","of","the","encoder",".","More","detail","of","the","whole","downsample","rate","can","be","found","in","UNet._check_input_divisible","."]
docstr: Convert the model into training mode while keep normalization layer
  freezed.
docstr_tok: ["Convert","the","model","into","training","mode","while","keep","normalization","layer","freezed","."]
code: def train(self, mode=True):
      """Convert the model into training mode while keep normalization layer
      freezed."""
      super(UNet, self).train(mode)
      if mode and self.norm_eval:
          for m in self.modules():
              # trick: eval have effect on BatchNorm only
              if isinstance(m, _BatchNorm):
                  m.eval()
  
imports: import torch.nn
  import torch.utils.checkpoint
  from annotator.uniformer.mmcv.cnn import UPSAMPLE_LAYERS, ConvModule, build_activation_layer, build_norm_layer, constant_init, kaiming_init
  from annotator.uniformer.mmcv.runner import load_checkpoint
  from annotator.uniformer.mmcv.utils.parrots_wrapper import _BatchNorm
  from annotator.uniformer.mmseg.utils import get_root_logger
  from ..builder import BACKBONES
  from ..utils import UpConvBlock
label_desc: Use image node_id 3 for calling the UNet obj's underlying member method code with example usage: obj.train(mode) without return types