class_docstr: Test class for `PerceptualEvaluationSpeechQuality` metric.
docstr: Test class implementation of metric.
docstr_tok: ["Test","class","implementation","of","metric","."]
code: def test_pesq(
      self, preds, target, ref_metric, fs, mode, num_processes, ddp
  ):
      """Test class implementation of metric."""
      if num_processes != 1 and ddp:
          pytest.skip("Multiprocessing and ddp does not work together")
      self.run_class_metric_test(
          ddp,
          preds,
          target,
          PerceptualEvaluationSpeechQuality,
          reference_metric=partial(
              _average_metric, metric_func=ref_metric
          ),
          metric_args={
              "fs": fs,
              "mode": mode,
              "n_processes": num_processes,
          },
      )
  
imports: from functools import partial
  import pytest
  import torch
  from pesq import pesq
  from scipy.io import wavfile
  from torch import Tensor
  from torchmetrics.audio import PerceptualEvaluationSpeechQuality
  from torchmetrics.functional.audio import perceptual_evaluation_speech_quality
  from unittests import _Input
  from unittests.audio import _SAMPLE_AUDIO_SPEECH, _SAMPLE_AUDIO_SPEECH_BAB_DB
  from unittests.helpers import seed_all
  from unittests.helpers.testers import MetricTester
label_desc: Use image node_id 1 for calling the TestPESQ obj's underlying member method code with example usage: obj.test_pesq(preds, target, ref_metric, fs, mode, num_processes, ddp) without return types