code: def test_raises_error_on_wrong_generator(generator, errortype, match):
      """Test that appropriate errors are raised on wrong generator."""
      with pytest.raises(errortype, match=match):
          perceptual_path_length(generator, conditional=True)
  
      ppl = PerceptualPathLength(conditional=True)
      with pytest.raises(errortype, match=match):
          ppl.update(generator=generator)
  
imports: from operator import attrgetter
  import pytest
  import torch
  import torch_fidelity
  from torch import nn
  from torch_fidelity.sample_similarity_lpips import SampleSimilarityLPIPS
  from torch_fidelity.utils import batch_interp
  from torchmetrics.functional.image.lpips import _LPIPS
  from torchmetrics.functional.image.perceptual_path_length import _interpolate, perceptual_path_length
  from torchmetrics.image.perceptual_path_length import PerceptualPathLength
  from torchmetrics.utilities.imports import _TORCH_FIDELITY_AVAILABLE
  from unittests import skip_on_running_out_of_memory
  from unittests.helpers import seed_all
label_desc: Use image node_id 4 for calling a global function with example usage: test_raises_error_on_wrong_generator(generator, errortype, match) without return types