code: def test_consistency_of_two_implementations() -> None:
      """Test that both backend functions for computing metric (depending on torch version) returns the same result."""
      shapes_test = [(5, 2, 2), (4, 3, 3), (4, 4, 4), (3, 5, 5)]
      for shp in shapes_test:
          metric_mtx = torch.randn(size=shp)
          bm1, bp1 = _find_best_perm_by_linear_sum_assignment(
              metric_mtx, torch.max
          )
          bm2, bp2 = _find_best_perm_by_exhaustive_method(
              metric_mtx, torch.max
          )
          assert torch.allclose(bm1, bm2)
          assert (bp1 == bp2).all()
  
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 7 for calling a global function with example usage: test_consistency_of_two_implementations() without return types