docstr: Args:
      spatial_dims: number of spatial dimensions of the input image.
      in_channels: number of input channels.
      out_channels: number of output channels.
      kernels: each integer k in `kernels` corresponds to a convolution layer with kernel size k.
      dilation: spacing between kernel elements.
      norm_type: feature normalization type and arguments.
          Defaults to ``("batch", {"affine": True})``.
      acti_type: {``"relu"``, ``"prelu"``, ``"relu6"``}
          Non-linear activation using ReLU or PReLU. Defaults to ``"relu"``.
      bias: whether to have a bias term in convolution blocks. Defaults to False.
          According to `Performance Tuning Guide <https://pytorch.org/tutorials/recipes/recipes/tuning_guide.html>`_,
          if a conv layer is directly followed by a batch norm layer, bias should be False.
      channel_matching: {``"pad"``, ``"project"``}
          Specifies handling residual branch and conv branch channel mismatches. Defaults to ``"pad"``.
  
          - ``"pad"``: with zero padding.
          - ``"project"``: with a trainable conv with kernel size one.
  
  Raises:
      ValueError: When ``channel_matching=pad`` and ``in_channels > out_channels``. Incompatible values.
docstr_tok: ["Args",":","spatial_dims",":","number","of","spatial","dimensions","of","the","input","image",".","in_channels",":","number","of","input","channels",".","out_channels",":","number","of","output","channels",".","kernels",":","each","integer","k","in","`","kernels","`","corresponds","to","a","convolution","layer","with","kernel","size","k.","dilation",":","spacing","between","kernel","elements",".","norm_type",":","feature","normalization","type","and","arguments",".","Defaults","to","``","(","``","batch","''",",","{","``","affine","''",":","True","}",")","``",".","acti_type",":","{","``","``","relu","''","``",",","``","``","prelu","''","``",",","``","``","relu6","''","``","}","Non-linear","activation","using","ReLU","or","PReLU",".","Defaults","to","``","``","relu","''","``",".","bias",":","whether","to","have","a","bias","term","in","convolution","blocks",".","Defaults","to","False",".","According","to","`","Performance","Tuning","Guide","<","https",":","\/\/pytorch.org\/tutorials\/recipes\/recipes\/tuning_guide.html",">","`","_",",","if","a","conv","layer","is","directly","followed","by","a","batch","norm","layer",",","bias","should","be","False",".","channel_matching",":","{","``","``","pad","''","``",",","``","``","project","''","``","}","Specifies","handling","residual","branch","and","conv","branch","channel","mismatches",".","Defaults","to","``","``","pad","''","``",".","-","``","``","pad","''","``",":","with","zero","padding",".","-","``","``","project","''","``",":","with","a","trainable","conv","with","kernel","size","one",".","Raises",":","ValueError",":","When","``","channel_matching=pad","``","and","``","in_channels",">","out_channels","``",".","Incompatible","values","."]
code: def __init__(
      self,
      spatial_dims: int,
      in_channels: int,
      out_channels: int,
      kernels: Sequence[int] = (3, 3),
      dilation: Sequence[int] | int = 1,
      norm_type: tuple | str = ("batch", {"affine": True}),
      acti_type: tuple | str = ("relu", {"inplace": True}),
      bias: bool = False,
      channel_matching: ChannelMatching | str = ChannelMatching.PAD,
  ) -> None:
      """
      Args:
          spatial_dims: number of spatial dimensions of the input image.
          in_channels: number of input channels.
          out_channels: number of output channels.
          kernels: each integer k in `kernels` corresponds to a convolution layer with kernel size k.
          dilation: spacing between kernel elements.
          norm_type: feature normalization type and arguments.
              Defaults to ``("batch", {"affine": True})``.
          acti_type: {``"relu"``, ``"prelu"``, ``"relu6"``}
              Non-linear activation using ReLU or PReLU. Defaults to ``"relu"``.
          bias: whether to have a bias term in convolution blocks. Defaults to False.
              According to `Performance Tuning Guide <https://pytorch.org/tutorials/recipes/recipes/tuning_guide.html>`_,
              if a conv layer is directly followed by a batch norm layer, bias should be False.
          channel_matching: {``"pad"``, ``"project"``}
              Specifies handling residual branch and conv branch channel mismatches. Defaults to ``"pad"``.
  
              - ``"pad"``: with zero padding.
              - ``"project"``: with a trainable conv with kernel size one.
  
      Raises:
          ValueError: When ``channel_matching=pad`` and ``in_channels > out_channels``. Incompatible values.
  
      """
      super().__init__()
      self.chn_pad = ChannelPad(
          spatial_dims=spatial_dims,
          in_channels=in_channels,
          out_channels=out_channels,
          mode=channel_matching,
      )
  
      layers = nn.ModuleList()
      _in_chns, _out_chns = in_channels, out_channels
  
      for kernel_size in kernels:
          layers.append(
              ADN(
                  ordering="NA",
                  in_channels=_in_chns,
                  act=acti_type,
                  norm=norm_type,
                  norm_dim=spatial_dims,
              )
          )
          layers.append(
              Convolution(
                  spatial_dims=spatial_dims,
                  in_channels=_in_chns,
                  out_channels=_out_chns,
                  kernel_size=kernel_size,
                  dilation=dilation,
                  bias=bias,
                  conv_only=True,
              )
          )
          _in_chns = _out_chns
  
      self.layers = nn.Sequential(*layers)
  
file_path: MONAI/monai/networks/nets/highresnet.py
imports: from __future__ import annotations
  from collections.abc import Sequence
  import torch
  import torch.nn
  from monai.networks.blocks import ADN, Convolution
  from monai.networks.layers.simplelayers import ChannelPad
  from monai.utils import ChannelMatching
label_desc: Use image node_id 1 to create a new HighResBlock object from inherited base classes: nn with example: obj = HighResBlock(spatial_dims, in_channels, out_channels, kernels, dilation, norm_type, acti_type, bias, channel_matching)