code: def _deduce_dims(
      feature_extractor: FeatureExtractor,
      input_size: tuple[int, int],
      layers: list[str],
  ) -> tuple[int, int]:
      """Run a dry run to deduce the dimensions of the extracted features.
  
      Important: `layers` is assumed to be ordered and the first (layers[0])
                  is assumed to be the layer with largest resolution.
  
      Returns:
          tuple[int, int]: Dimensions of the extracted features: (n_dims_original, n_patches)
      """
      dimensions_mapping = dryrun_find_featuremap_dims(
          feature_extractor, input_size, layers
      )
  
      # the first layer in `layers` has the largest resolution
      first_layer_resolution = dimensions_mapping[layers[0]][
          "resolution"
      ]
      n_patches = (
          torch.tensor(first_layer_resolution).prod().int().item()
      )
  
      # the original embedding size is the sum of the channels of all layers
      n_features_original = sum(dimensions_mapping[layer]["num_features"] for layer in layers)  # type: ignore
  
      return n_features_original, n_patches
  
file_path: anomalib/src/anomalib/models/padim/torch_model.py
imports: from __future__ import annotations
  from random import sample
  import torch
  import torch.nn.functional
  from torch import Tensor, nn
  from anomalib.models.components import FeatureExtractor, MultiVariateGaussian
  from anomalib.models.components.feature_extractors import dryrun_find_featuremap_dims
  from anomalib.models.padim.anomaly_map import AnomalyMapGenerator
  from anomalib.pre_processing import Tiler
label_desc: Use image node_id 1 for calling a global function with example usage: _deduce_dims(feature_extractor, input_size, layers) and returns: n_features_original,  n_patches