code: def __init__(
      self, n_blocks: list[int], block: type[BasicBlockD | BottleneckD]
  ) -> None:
      KORNIA_CHECK(len(n_blocks) == 4)
      super().__init__()
      in_channels = 64
      self.conv1 = nn.Sequential(
          ConvNormAct(3, in_channels // 2, 3, stride=2),
          ConvNormAct(in_channels // 2, in_channels // 2, 3),
          ConvNormAct(in_channels // 2, in_channels, 3),
          nn.MaxPool2d(3, stride=2, padding=1),
      )
  
      self.res2, in_channels = self.make_stage(
          in_channels, 64, 1, n_blocks[0], block
      )
      self.res3, in_channels = self.make_stage(
          in_channels, 128, 2, n_blocks[1], block
      )
      self.res4, in_channels = self.make_stage(
          in_channels, 256, 2, n_blocks[2], block
      )
      self.res5, in_channels = self.make_stage(
          in_channels, 512, 2, n_blocks[3], block
      )
  
      self.out_channels = [
          ch * block.expansion for ch in [128, 256, 512]
      ]
  
imports: from __future__ import annotations
  from torch import nn
  from kornia.contrib.models.common import ConvNormAct
  from kornia.core import Module, Tensor
  from kornia.core.check import KORNIA_CHECK
label_desc: Use image node_id 1 to create a new ResNetD object from inherited base classes: Module with example: obj = ResNetD(n_blocks, block)