class_docstr: Descriptor module.
class_docstr_tok: ["Descriptor","module","."]
docstr: Forward pass.
docstr_tok: ["Forward","pass","."]
code: def forward(
      self, features: list[Tensor] | dict[str, Tensor]
  ) -> Tensor:
      """Forward pass."""
      if isinstance(features, dict):
          features = list(features.values())
  
      patch_features: Tensor | None = None
      for i in features:
          i = (
              F.avg_pool2d(i, 3, 1, 1) / i.size(1)
              if self.backbone == "efficientnet_b5"
              else F.avg_pool2d(i, 3, 1, 1)
          )
          patch_features = (
              i
              if patch_features is None
              else torch.cat(
                  (
                      patch_features,
                      F.interpolate(
                          i, patch_features.size(2), mode="bilinear"
                      ),
                  ),
                  dim=1,
              )
          )
  
      target_oriented_features = self.layer(patch_features)
      return target_oriented_features
  
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 2 for calling the Descriptor obj's underlying member method code with example usage: obj.forward(features) and returns: target_oriented_features