code: def from_config(variant: str | int) -> ResNetD:
      variant = str(variant)
      if variant == "18":
          return ResNetD([2, 2, 2, 2], BasicBlockD)
      elif variant == "34":
          return ResNetD([3, 4, 6, 3], BasicBlockD)
      elif variant == "50":
          return ResNetD([3, 4, 6, 3], BottleneckD)
      elif variant == "101":
          return ResNetD([3, 4, 23, 3], BottleneckD)
      elif variant == "152":
          return ResNetD([3, 8, 36, 3], BottleneckD)
      else:
          raise ValueError(
              "Only variant 18, 34, 50, 101, and 152 are supported"
          )
  
file_path: kornia/kornia/contrib/models/rt_detr/architecture/resnet_d.py
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 4 for calling the ResNetD obj's underlying member method code with example usage: obj.from_config(variant) and returns: ResNetD, ResNetD, ResNetD, ResNetD, ResNetD