docstr: Args:
      in_planes: number of input channels.
      planes: number of output channels.
      spatial_dims: number of spatial dimensions of the input image.
      stride: stride to use for first conv layer.
      downsample: which downsample layer to use.
docstr_tok: ["Args",":","in_planes",":","number","of","input","channels",".","planes",":","number","of","output","channels",".","spatial_dims",":","number","of","spatial","dimensions","of","the","input","image",".","stride",":","stride","to","use","for","first","conv","layer",".","downsample",":","which","downsample","layer","to","use","."]
code: def __init__(
      self,
      in_planes: int,
      planes: int,
      spatial_dims: int = 3,
      stride: int = 1,
      downsample: nn.Module | partial | None = None,
  ) -> None:
      """
      Args:
          in_planes: number of input channels.
          planes: number of output channels.
          spatial_dims: number of spatial dimensions of the input image.
          stride: stride to use for first conv layer.
          downsample: which downsample layer to use.
      """
      super().__init__()
  
      conv_type: Callable = Conv[Conv.CONV, spatial_dims]
      norm_type: Callable = Norm[Norm.BATCH, spatial_dims]
  
      self.conv1 = conv_type(
          in_planes,
          planes,
          kernel_size=3,
          padding=1,
          stride=stride,
          bias=False,
      )
      self.bn1 = norm_type(planes)
      self.relu = nn.ReLU(inplace=True)
      self.conv2 = conv_type(
          planes, planes, kernel_size=3, padding=1, bias=False
      )
      self.bn2 = norm_type(planes)
      self.downsample = downsample
      self.stride = stride
  
imports: from __future__ import annotations
  import logging
  import re
  from collections.abc import Callable
  from functools import partial
  from pathlib import Path
  from typing import Any
  import torch
  import torch.nn
  from monai.networks.layers.factories import Conv, Norm, Pool
  from monai.networks.layers.utils import get_pool_layer
  from monai.utils import ensure_tuple_rep
  from monai.utils.module import look_up_option, optional_import
label_desc: Use image node_id 1 to create a new ResNetBlock object from inherited base classes: nn with example: obj = ResNetBlock(in_planes, planes, spatial_dims, stride, downsample)