class_docstr: Test class for `PermutationInvariantTraining` metric.
class_docstr_tok: ["Test","class","for","`","PermutationInvariantTraining","`","metric","."]
docstr: Test class implementation of metric.
docstr_tok: ["Test","class","implementation","of","metric","."]
code: def test_pit(
      self, preds, target, ref_metric, metric_func, mode, eval_func, ddp
  ):
      """Test class implementation of metric."""
      self.run_class_metric_test(
          ddp,
          preds,
          target,
          PermutationInvariantTraining,
          reference_metric=partial(
              _average_metric, metric_func=ref_metric
          ),
          metric_args={
              "metric_func": metric_func,
              "mode": mode,
              "eval_func": eval_func,
          },
      )
  
imports: from functools import partial
  from typing import Callable, Tuple
  import numpy
  import pytest
  import torch
  from scipy.optimize import linear_sum_assignment
  from torch import Tensor
  from torchmetrics.audio import PermutationInvariantTraining
  from torchmetrics.functional.audio import permutation_invariant_training, scale_invariant_signal_distortion_ratio, signal_noise_ratio
  from torchmetrics.functional.audio.pit import _find_best_perm_by_exhaustive_method, _find_best_perm_by_linear_sum_assignment
  from unittests import BATCH_SIZE, NUM_BATCHES, _Input
  from unittests.helpers import seed_all
  from unittests.helpers.testers import MetricTester
label_desc: Use image node_id 1 for calling the TestPIT obj's underlying member method code with example usage: obj.test_pit(preds, target, ref_metric, metric_func, mode, eval_func, ddp) without return types