code: def test_compare():
      """Test against torch_fidelity.
  
      Because it is a sample based metric, the results are not deterministic. Thus we need a large amount of samples to
      even get close to the reference value. Even then we are going to allow a 6% deviation on the mean and 6% deviation
      on the standard deviation.
  
      """
      generator = DummyGenerator(128)
  
      compare = torch_fidelity.calculate_metrics(
          input1=torch_fidelity.GenerativeModelModuleWrapper(
              generator, 128, "normal", 10
          ),
          input1_model_num_samples=50000,
          ppl=True,
          ppl_reduction="none",
          input_model_num_classes=0,
          ppl_discard_percentile_lower=None,
          ppl_discard_percentile_higher=None,
      )
      compare = torch.tensor(compare["perceptual_path_length_raw"])
  
      result = perceptual_path_length(
          generator,
          num_samples=50000,
          conditional=False,
          lower_discard=None,
          upper_discard=None,
          device="cuda",
      )
      result = result[-1].cpu()
  
      assert (
          0.94 * result.mean() <= compare.mean() <= 1.06 * result.mean()
      )
      assert 0.94 * result.std() <= compare.std() <= 1.06 * result.std()
  
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 5 for calling a global function with example usage: test_compare() without return types