code: def test_error_on_missing_feature_network():
      """Test that an error is raised when the feature network is missing."""
      with pytest.raises(
          AttributeError,
          match="Tried to extract the network to share from the first metric.*",
      ):
          FeatureShare(
              [
                  StructuralSimilarityIndexMeasure(),
                  FrechetInceptionDistance(),
              ]
          )
  
      with pytest.raises(
          AttributeError,
          match="Tried to set the cached network to all metrics, but one of the.*",
      ):
          FeatureShare(
              [
                  FrechetInceptionDistance(),
                  StructuralSimilarityIndexMeasure(),
              ]
          )
  
file_path: torchmetrics/tests/unittests/wrappers/test_feature_share.py
imports: import pytest
  import torch
  from torchmetrics import MetricCollection
  from torchmetrics.image import FrechetInceptionDistance, InceptionScore, KernelInceptionDistance, LearnedPerceptualImagePatchSimilarity, StructuralSimilarityIndexMeasure
  from torchmetrics.wrappers import FeatureShare
label_desc: Use image node_id 2 for calling a global function with example usage: test_error_on_missing_feature_network() without return types