code: def _ref_metric_batch(
      preds: Tensor,
      target: Tensor,
      fs: int,
      fast: bool,
      norm: bool,
      **kwargs: Dict[str, Any],
  ):
      # shape: preds [BATCH_SIZE, Time]
      shape = preds.shape
      preds = (
          preds.reshape(1, -1)
          if len(shape) == 1
          else preds.reshape(-1, shape[-1])
      )
      n_batch, time = preds.shape
  
      preds = preds.detach().cpu().numpy()
      score = []
      for b in range(preds.shape[0]):
          val, _ = srmrpy_srmr(
              preds[b, ...],
              fs=fs,
              fast=fast,
              norm=norm,
              max_cf=128 if not norm else 30,
          )
          score.append(val)
      score = torch.tensor(score)
      return score.reshape(*shape[:-1])
  
imports: from functools import partial
  from typing import Any, Dict
  import pytest
  import torch
  from srmrpy import srmr
  from torch import Tensor
  from torchmetrics.audio.srmr import SpeechReverberationModulationEnergyRatio
  from torchmetrics.functional.audio.srmr import speech_reverberation_modulation_energy_ratio
  from torchmetrics.utilities.imports import _TORCHAUDIO_GREATER_EQUAL_0_10
  from unittests.helpers import seed_all
  from unittests.helpers.testers import MetricTester
label_desc: Use image node_id 1 for calling a global function with example usage: _ref_metric_batch(preds, target, fs, fast, norm) and returns: score