class_docstr: Descriptor module.
class_docstr_tok: ["Descriptor","module","."]
code: def __init__(self, gamma_d: int, backbone: str) -> None:
      super().__init__()
  
      self.backbone = backbone
      if self.backbone not in SUPPORTED_BACKBONES:
          raise ValueError(
              f"Supported backbones are {SUPPORTED_BACKBONES}. Got {self.backbone} instead."
          )
  
      # TODO: Automatically infer the number of dims
      backbone_dims = {
          "vgg19_bn": 1280,
          "resnet18": 448,
          "wide_resnet50_2": 1792,
          "efficientnet_b5": 568,
      }
      dim = backbone_dims[backbone]
      out_channels = (
          2 * dim // gamma_d
          if backbone == "efficientnet_b5"
          else dim // gamma_d
      )
  
      self.layer = CoordConv2d(
          in_channels=dim, out_channels=out_channels, kernel_size=1
      )
  
imports: from __future__ import annotations
  import torch
  import torch.nn.functional
  import torchvision
  from einops import rearrange
  from sklearn.cluster import KMeans
  from torch import Tensor, nn
  from torch.fx.graph_module import GraphModule
  from torch.nn.common_types import _size_2_t
  from torch.utils.data import DataLoader
  from torchvision.models.feature_extraction import create_feature_extractor
  from tqdm import tqdm
  from anomalib.models.cfa.anomaly_map import AnomalyMapGenerator
  from anomalib.models.components import DynamicBufferModule
  from anomalib.models.components.feature_extractors import dryrun_find_featuremap_dims
label_desc: Use image node_id 1 to create a new Descriptor object from inherited base classes: nn with example: obj = Descriptor(gamma_d, backbone)