class_docstr: Args:
      input_channels (int): The input channels of nnUNet.
      base_num_features (int): Basic number of nnUNet channels.
      num_pool (int): The number of MaxPooling.
      num_conv_per_stage (int | optional): The number of conv-bn-nonlin blocks in every stage. Default: 2.
      feat_map_mul_on_downscale (int | optional): The expansion ratio of stage channels. Defatult: 2.
      conv_op (paddle.nn.Layer | optional): The type of conv layer, only support nn.Conv2D and nn.Conv3D. Default: nn.Conv2D.
      norm_op (paddle.nn.Layer | optional): The type of batchnorm layer. Default: nn.BatchNorm2D.
      norm_op_kwwargs (dict | optional): The params for norm_op.
      dropout_op (paddle.nn.Layer | optional): The type of dropout layer. Default: nn.Dropout2D.
      dropout_op_kwargs (dict | optional): The params for dropout_op.
      nonlin (paddle.nn.Layer | optional): The type of activation layer. Default: nn.LeakyReLU.
      nonlin_kwargs (dict | optional): The params for nonlin.
      deep_supervision (bool | optional): Whether return multi-scale feats when training mode. Default: True.
      use_dropout (bool | optional): Whether use dropout layer in model. Default: False.
      pool_op_kernel_sizes (list | optional): The kernel_sizes of pool layers. If None, this param will be computed from num_pool automatically. Default: None.
      conv_kernel_sizes (list | optional): The kernel_sizes of conv layers. If None, this param will be computed from num_pool automatically. Default: None.
      upscale_logits (bool | optional): Whether upscale output feats with different resolutions to the same resolution. Defatult: False.
      convolutional_pooling (bool | optional): Whether add pool layer after conv layer. If convolutional_pooling is True, only conv layer is used and reduce resolution by conv stride. Default: False.
      convolutional_upsampling (bool | optional): Use transpose conv layer or interpolate to upsample feature maps. If True, using transpose conv. Default: False.
      max_num_features (int | optional): The maximum channels of feature maps. Default: None.
      basic_block (paddle.nn.Layer): Only use conv-drop-norm-nonlin module. Default: layers.ConvDropoutNormNonlin.
      seg_output_use_bias (bool | optional): Whether use bias in segmentation head. Default: False.
class_docstr_tok: ["Args",":","input_channels","(","int",")",":","The","input","channels","of","nnUNet",".","base_num_features","(","int",")",":","Basic","number","of","nnUNet","channels",".","num_pool","(","int",")",":","The","number","of","MaxPooling",".","num_conv_per_stage","(","int","|","optional",")",":","The","number","of","conv-bn-nonlin","blocks","in","every","stage",".","Default",":","2.","feat_map_mul_on_downscale","(","int","|","optional",")",":","The","expansion","ratio","of","stage","channels",".","Defatult",":","2.","conv_op","(","paddle.nn.Layer","|","optional",")",":","The","type","of","conv","layer",",","only","support","nn.Conv2D","and","nn.Conv3D",".","Default",":","nn.Conv2D",".","norm_op","(","paddle.nn.Layer","|","optional",")",":","The","type","of","batchnorm","layer",".","Default",":","nn.BatchNorm2D",".","norm_op_kwwargs","(","dict","|","optional",")",":","The","params","for","norm_op",".","dropout_op","(","paddle.nn.Layer","|","optional",")",":","The","type","of","dropout","layer",".","Default",":","nn.Dropout2D",".","dropout_op_kwargs","(","dict","|","optional",")",":","The","params","for","dropout_op",".","nonlin","(","paddle.nn.Layer","|","optional",")",":","The","type","of","activation","layer",".","Default",":","nn.LeakyReLU",".","nonlin_kwargs","(","dict","|","optional",")",":","The","params","for","nonlin",".","deep_supervision","(","bool","|","optional",")",":","Whether","return","multi-scale","feats","when","training","mode",".","Default",":","True",".","use_dropout","(","bool","|","optional",")",":","Whether","use","dropout","layer","in","model",".","Default",":","False",".","pool_op_kernel_sizes","(","list","|","optional",")",":","The","kernel_sizes","of","pool","layers",".","If","None",",","this","param","will","be","computed","from","num_pool","automatically",".","Default",":","None",".","conv_kernel_sizes","(","list","|","optional",")",":","The","kernel_sizes","of","conv","layers",".","If","None",",","this","param","will","be","computed","from","num_pool","automatically",".","Default",":","None",".","upscale_logits","(","bool","|","optional",")",":","Whether","upscale","output","feats","with","different","resolutions","to","the","same","resolution",".","Defatult",":","False",".","convolutional_pooling","(","bool","|","optional",")",":","Whether","add","pool","layer","after","conv","layer",".","If","convolutional_pooling","is","True",",","only","conv","layer","is","used","and","reduce","resolution","by","conv","stride",".","Default",":","False",".","convolutional_upsampling","(","bool","|","optional",")",":","Use","transpose","conv","layer","or","interpolate","to","upsample","feature","maps",".","If","True",",","using","transpose","conv",".","Default",":","False",".","max_num_features","(","int","|","optional",")",":","The","maximum","channels","of","feature","maps",".","Default",":","None",".","basic_block","(","paddle.nn.Layer",")",":","Only","use","conv-drop-norm-nonlin","module",".","Default",":","layers.ConvDropoutNormNonlin",".","seg_output_use_bias","(","bool","|","optional",")",":","Whether","use","bias","in","segmentation","head",".","Default",":","False","."]
code: def forward(self, x):
      skips = []
      outputs = []
      for d in range(len(self.conv_blocks_context) - 1):
          x = self.conv_blocks_context[d](x)
          skips.append(x)
          if not self.convolutional_pooling:
              x = self.pool_layers[d](x)
  
      x = self.conv_blocks_context[-1](x)
  
      for u in range(len(self.upsample_ops)):
          x = self.upsample_ops[u](x)
          x = paddle.concat([x, skips[-(u + 1)]], axis=1)
          x = self.conv_blocks_localization[u](x)
          outputs.append(self.seg_heads[u](x))
  
      if self._deep_supervision and self.training:
          return [
              [outputs[-1]]
              + [
                  up_op(feat)
                  for up_op, feat in zip(
                      list(self.upscale_logits_ops)[::-1],
                      outputs[:-1][::-1],
                  )
              ]
          ]
      else:
          return [outputs[-1]]
  
imports: import os
  import sys
  import pickle
  import numpy
  from copy import deepcopy
  import paddle
  import paddle.nn
  import paddle.nn.functional
  from medicalseg.cvlibs import manager
  from medicalseg.utils import utils
  from medicalseg.cvlibs import param_init
  from medicalseg.models import layers
  from tools.preprocess_utils import experiment_planner
label_desc: Use image node_id 2 for calling the Generic_UNet obj's underlying member method code with example usage: obj.forward(x) and returns: list, list