class_docstr: Patchcore Module.
class_docstr_tok: ["Patchcore","Module","."]
code: def __init__(
      self,
      input_size: tuple[int, int],
      layers: list[str],
      backbone: str = "wide_resnet50_2",
      pre_trained: bool = True,
      num_neighbors: int = 9,
  ) -> None:
      super().__init__()
      self.tiler: Tiler | None = None
  
      self.backbone = backbone
      self.layers = layers
      self.input_size = input_size
      self.num_neighbors = num_neighbors
  
      self.feature_extractor = FeatureExtractor(
          backbone=self.backbone,
          pre_trained=pre_trained,
          layers=self.layers,
      )
      self.feature_pooler = torch.nn.AvgPool2d(3, 1, 1)
      self.anomaly_map_generator = AnomalyMapGenerator(
          input_size=input_size
      )
  
      self.register_buffer("memory_bank", Tensor())
      self.memory_bank: Tensor
  
file_path: anomalib/src/anomalib/models/patchcore/torch_model.py
imports: from __future__ import annotations
  import torch
  import torch.nn.functional
  from torch import Tensor, nn
  from anomalib.models.components import DynamicBufferModule, FeatureExtractor, KCenterGreedy
  from anomalib.models.patchcore.anomaly_map import AnomalyMapGenerator
  from anomalib.pre_processing import Tiler
label_desc: Use image node_id 1 to create a new PatchcoreModel object from inherited base classes: DynamicBufferModule, nn with example: obj = PatchcoreModel(input_size, layers, backbone, pre_trained, num_neighbors)