code: def test_timm_feature_extraction(self, backbone, pretrained):
      layers = ["layer1", "layer2", "layer3"]
      model = FeatureExtractor(
          backbone=backbone, layers=layers, pre_trained=pretrained
      )
      test_input = torch.rand((32, 3, 256, 256))
      features = model(test_input)
  
      if backbone == "resnet18":
          assert features["layer1"].shape == torch.Size(
              (32, 64, 64, 64)
          )
          assert features["layer2"].shape == torch.Size(
              (32, 128, 32, 32)
          )
          assert features["layer3"].shape == torch.Size(
              (32, 256, 16, 16)
          )
          assert model.out_dims == [64, 128, 256]
          assert model.idx == [1, 2, 3]
      elif backbone == "wide_resnet50_2":
          assert features["layer1"].shape == torch.Size(
              (32, 256, 64, 64)
          )
          assert features["layer2"].shape == torch.Size(
              (32, 512, 32, 32)
          )
          assert features["layer3"].shape == torch.Size(
              (32, 1024, 16, 16)
          )
          assert model.out_dims == [256, 512, 1024]
          assert model.idx == [1, 2, 3]
      else:
          pass
  
file_path: anomalib/tests/pre_merge/models/test_feature_extractor.py
imports: from tempfile import TemporaryDirectory
  from typing import Tuple
  import pytest
  import torch
  from torchvision.models import ResNet18_Weights, resnet18
  from torchvision.models.efficientnet import EfficientNet_B5_Weights
  from anomalib.models.components.feature_extractors import BackboneParams, FeatureExtractor, TorchFXFeatureExtractor, dryrun_find_featuremap_dims
  from tests.helpers.dummy import DummyModel
label_desc: Use image node_id 1 for calling the TestFeatureExtractor obj's underlying member method code with example usage: obj.test_timm_feature_extraction(backbone, pretrained) without return types