class_docstr: Residual network block used SegResNet based on `3D MRI brain tumor segmentation using autoencoder regularization
  <https://arxiv.org/pdf/1810.11654.pdf>`_.
class_docstr_tok: ["Residual","network","block","used","SegResNet","based","on","`","3D","MRI","brain","tumor","segmentation","using","autoencoder","regularization","<","https",":","\/\/arxiv.org\/pdf\/1810.11654.pdf",">","`","_","."]
docstr: Args:
      spatial_dims: number of spatial dimensions, could be 1, 2 or 3.
      in_channels: number of input channels.
      norm: feature normalization type and arguments.
      kernel_size: convolution kernel size. Defaults to 3.
      act: activation type and arguments. Defaults to ``RELU``.
docstr_tok: ["Args",":","spatial_dims",":","number","of","spatial","dimensions",",","could","be","1",",","2","or","3.","in_channels",":","number","of","input","channels",".","norm",":","feature","normalization","type","and","arguments",".","kernel_size",":","convolution","kernel","size",".","Defaults","to","3.","act",":","activation","type","and","arguments",".","Defaults","to","``","RELU","``","."]
code: def __init__(
      self,
      spatial_dims: int,
      in_channels: int,
      norm: tuple | str,
      kernel_size: tuple | int = 3,
      act: tuple | str = "relu",
  ) -> None:
      """
      Args:
          spatial_dims: number of spatial dimensions, could be 1, 2 or 3.
          in_channels: number of input channels.
          norm: feature normalization type and arguments.
          kernel_size: convolution kernel size. Defaults to 3.
          act: activation type and arguments. Defaults to ``RELU``.
      """
      super().__init__()
  
      if isinstance(kernel_size, (tuple, list)):
          padding = tuple(k // 2 for k in kernel_size)
      else:
          padding = kernel_size // 2  # type: ignore
  
      self.norm1 = get_norm_layer(
          name=norm, spatial_dims=spatial_dims, channels=in_channels
      )
      self.act1 = get_act_layer(act)
      self.conv1 = Conv[Conv.CONV, spatial_dims](
          in_channels=in_channels,
          out_channels=in_channels,
          kernel_size=kernel_size,
          stride=1,
          padding=padding,
          bias=False,
      )
  
      self.norm2 = get_norm_layer(
          name=norm, spatial_dims=spatial_dims, channels=in_channels
      )
      self.act2 = get_act_layer(act)
      self.conv2 = Conv[Conv.CONV, spatial_dims](
          in_channels=in_channels,
          out_channels=in_channels,
          kernel_size=kernel_size,
          stride=1,
          padding=padding,
          bias=False,
      )
  
imports: from __future__ import annotations
  from collections.abc import Callable
  from typing import Union
  import numpy
  import torch
  import torch.nn
  from monai.networks.blocks.upsample import UpSample
  from monai.networks.layers.factories import Act, Conv, Norm, split_args
  from monai.networks.layers.utils import get_act_layer, get_norm_layer
  from monai.utils import UpsampleMode, has_option
label_desc: Use image node_id 1 to create a new SegResBlock object from inherited base classes: nn with example: obj = SegResBlock(spatial_dims, in_channels, norm, kernel_size, act)