code: def _average_metric(preds, target, metric_func):
      # shape: preds [BATCH_SIZE, 1, Time] , target [BATCH_SIZE, 1, Time]
      # or shape: preds [NUM_BATCHES*BATCH_SIZE, 1, Time] , target [NUM_BATCHES*BATCH_SIZE, 1, Time]
      return metric_func(preds, target).mean()
  
file_path: torchmetrics/tests/unittests/audio/test_si_snr.py
imports: from functools import partial
  import pytest
  import speechmetrics
  import torch
  from torch import Tensor
  from torchmetrics.audio import ScaleInvariantSignalNoiseRatio
  from torchmetrics.functional.audio import scale_invariant_signal_noise_ratio
  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 2 for calling a global function with example usage: _average_metric(preds, target, metric_func) and returns: metric_func