class_docstr: upsampling, concatenation with the encoder feature map, two convolutions
class_docstr_tok: ["upsampling",",","concatenation","with","the","encoder","feature","map",",","two","convolutions"]
docstr: Args:
      spatial_dims: number of spatial dimensions.
      in_chns: number of input channels to be upsampled.
      cat_chns: number of channels from the encoder.
      out_chns: number of output channels.
      act: activation type and arguments.
      norm: feature normalization type and arguments.
      bias: whether to have a bias term in convolution blocks.
      dropout: dropout ratio. Defaults to no dropout.
      upsample: upsampling mode, available options are
          ``"deconv"``, ``"pixelshuffle"``, ``"nontrainable"``.
      pre_conv: a conv block applied before upsampling.
          Only used in the "nontrainable" or "pixelshuffle" mode.
      interp_mode: {``"nearest"``, ``"linear"``, ``"bilinear"``, ``"bicubic"``, ``"trilinear"``}
          Only used in the "nontrainable" mode.
      align_corners: set the align_corners parameter for upsample. Defaults to True.
          Only used in the "nontrainable" mode.
      halves: whether to halve the number of channels during upsampling.
          This parameter does not work on ``nontrainable`` mode if ``pre_conv`` is `None`.
      is_pad: whether to pad upsampling features to fit features from encoder. Defaults to True.
docstr_tok: ["Args",":","spatial_dims",":","number","of","spatial","dimensions",".","in_chns",":","number","of","input","channels","to","be","upsampled",".","cat_chns",":","number","of","channels","from","the","encoder",".","out_chns",":","number","of","output","channels",".","act",":","activation","type","and","arguments",".","norm",":","feature","normalization","type","and","arguments",".","bias",":","whether","to","have","a","bias","term","in","convolution","blocks",".","dropout",":","dropout","ratio",".","Defaults","to","no","dropout",".","upsample",":","upsampling","mode",",","available","options","are","``","``","deconv","''","``",",","``","``","pixelshuffle","''","``",",","``","``","nontrainable","''","``",".","pre_conv",":","a","conv","block","applied","before","upsampling",".","Only","used","in","the","``","nontrainable","''","or","``","pixelshuffle","''","mode",".","interp_mode",":","{","``","``","nearest","''","``",",","``","``","linear","''","``",",","``","``","bilinear","''","``",",","``","``","bicubic","''","``",",","``","``","trilinear","''","``","}","Only","used","in","the","``","nontrainable","''","mode",".","align_corners",":","set","the","align_corners","parameter","for","upsample",".","Defaults","to","True",".","Only","used","in","the","``","nontrainable","''","mode",".","halves",":","whether","to","halve","the","number","of","channels","during","upsampling",".","This","parameter","does","not","work","on","``","nontrainable","``","mode","if","``","pre_conv","``","is","`","None","`",".","is_pad",":","whether","to","pad","upsampling","features","to","fit","features","from","encoder",".","Defaults","to","True","."]
code: def __init__(
      self,
      spatial_dims: int,
      in_chns: int,
      cat_chns: int,
      out_chns: int,
      act: str | tuple,
      norm: str | tuple,
      bias: bool,
      dropout: float | tuple = 0.0,
      upsample: str = "deconv",
      pre_conv: nn.Module | str | None = "default",
      interp_mode: str = "linear",
      align_corners: bool | None = True,
      halves: bool = True,
      is_pad: bool = True,
  ):
      """
      Args:
          spatial_dims: number of spatial dimensions.
          in_chns: number of input channels to be upsampled.
          cat_chns: number of channels from the encoder.
          out_chns: number of output channels.
          act: activation type and arguments.
          norm: feature normalization type and arguments.
          bias: whether to have a bias term in convolution blocks.
          dropout: dropout ratio. Defaults to no dropout.
          upsample: upsampling mode, available options are
              ``"deconv"``, ``"pixelshuffle"``, ``"nontrainable"``.
          pre_conv: a conv block applied before upsampling.
              Only used in the "nontrainable" or "pixelshuffle" mode.
          interp_mode: {``"nearest"``, ``"linear"``, ``"bilinear"``, ``"bicubic"``, ``"trilinear"``}
              Only used in the "nontrainable" mode.
          align_corners: set the align_corners parameter for upsample. Defaults to True.
              Only used in the "nontrainable" mode.
          halves: whether to halve the number of channels during upsampling.
              This parameter does not work on ``nontrainable`` mode if ``pre_conv`` is `None`.
          is_pad: whether to pad upsampling features to fit features from encoder. Defaults to True.
  
      """
      super().__init__()
      if upsample == "nontrainable" and pre_conv is None:
          up_chns = in_chns
      else:
          up_chns = in_chns // 2 if halves else in_chns
      self.upsample = UpSample(
          spatial_dims,
          in_chns,
          up_chns,
          2,
          mode=upsample,
          pre_conv=pre_conv,
          interp_mode=interp_mode,
          align_corners=align_corners,
      )
      self.convs = TwoConv(
          spatial_dims,
          cat_chns + up_chns,
          out_chns,
          act,
          norm,
          bias,
          dropout,
      )
      self.is_pad = is_pad
  
imports: from __future__ import annotations
  from collections.abc import Sequence
  from typing import Optional
  import torch
  import torch.nn
  from monai.networks.blocks import Convolution, UpSample
  from monai.networks.layers.factories import Conv, Pool
  from monai.utils import ensure_tuple_rep
label_desc: Use image node_id 1 to create a new UpCat object from inherited base classes: nn with example: obj = UpCat(spatial_dims, in_chns, cat_chns, out_chns, act, norm, bias, dropout, upsample, pre_conv, interp_mode, align_corners, halves, is_pad)