class_docstr: An up-sample module that can be used for LocalNet, based on:
  `Weakly-supervised convolutional neural networks for multimodal image registration
  <https://doi.org/10.1016/j.media.2018.07.002>`_.
  `Label-driven weakly-supervised learning for multimodal deformable image registration
  <https://arxiv.org/abs/1711.01666>`_.
  
  Adapted from:
      DeepReg (https://github.com/DeepRegNet/DeepReg)
docstr: Args:
      spatial_dims: number of spatial dimensions.
      in_channels: number of input channels.
      out_channels: number of output channels.
      mode: interpolation mode of the additive upsampling, default to 'nearest'.
      align_corners: whether to align corners for the additive upsampling, default to None.
  Raises:
      ValueError: when ``in_channels != 2 * out_channels``
docstr_tok: ["Args",":","spatial_dims",":","number","of","spatial","dimensions",".","in_channels",":","number","of","input","channels",".","out_channels",":","number","of","output","channels",".","mode",":","interpolation","mode","of","the","additive","upsampling",",","default","to","'nearest","'",".","align_corners",":","whether","to","align","corners","for","the","additive","upsampling",",","default","to","None",".","Raises",":","ValueError",":","when","``","in_channels","!","=","2","*","out_channels","``"]
code: def __init__(
      self,
      spatial_dims: int,
      in_channels: int,
      out_channels: int,
      mode: str = "nearest",
      align_corners: bool | None = None,
  ) -> None:
      """
      Args:
          spatial_dims: number of spatial dimensions.
          in_channels: number of input channels.
          out_channels: number of output channels.
          mode: interpolation mode of the additive upsampling, default to 'nearest'.
          align_corners: whether to align corners for the additive upsampling, default to None.
      Raises:
          ValueError: when ``in_channels != 2 * out_channels``
      """
      super().__init__()
      self.deconv_block = get_deconv_block(
          spatial_dims=spatial_dims,
          in_channels=in_channels,
          out_channels=out_channels,
      )
      self.conv_block = get_conv_block(
          spatial_dims=spatial_dims,
          in_channels=out_channels,
          out_channels=out_channels,
      )
      self.residual_block = LocalNetResidualBlock(
          spatial_dims=spatial_dims,
          in_channels=out_channels,
          out_channels=out_channels,
      )
      if in_channels / out_channels != 2:
          raise ValueError(
              f"expecting in_channels == 2 * out_channels, "
              f"got in_channels={in_channels}, out_channels={out_channels}"
          )
      self.out_channels = out_channels
      self.mode = mode
      self.align_corners = align_corners
  
imports: from __future__ import annotations
  from collections.abc import Sequence
  import torch
  from torch import nn
  from torch.nn import functional
  from monai.networks.blocks import Convolution
  from monai.networks.layers import same_padding
  from monai.networks.layers.factories import Conv, Norm, Pool
label_desc: Use image node_id 1 to create a new LocalNetUpSampleBlock object from inherited base classes: nn with example: obj = LocalNetUpSampleBlock(spatial_dims, in_channels, out_channels, mode, align_corners)