class_docstr: Test class for `PermutationInvariantTraining` metric.
class_docstr_tok: ["Test","class","for","`","PermutationInvariantTraining","`","metric","."]
docstr: Test dtype support of the metric on GPU.
docstr_tok: ["Test","dtype","support","of","the","metric","on","GPU","."]
code: def test_pit_half_gpu(
      self, preds, target, ref_metric, metric_func, mode, eval_func
  ):
      """Test dtype support of the metric on GPU."""
      self.run_precision_test_gpu(
          preds=preds,
          target=target,
          metric_module=PermutationInvariantTraining,
          metric_functional=partial(
              permutation_invariant_training,
              metric_func=metric_func,
              eval_func=eval_func,
          ),
          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 5 for calling the TestPIT obj's underlying member method code with example usage: obj.test_pit_half_gpu(preds, target, ref_metric, metric_func, mode, eval_func) without return types