code: def _speechmetrics_si_sdr(
      preds: Tensor, target: Tensor, zero_mean: bool
  ):
      # 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]
      if zero_mean:
          preds = preds - preds.mean(dim=2, keepdim=True)
          target = target - target.mean(dim=2, keepdim=True)
      target = target.detach().cpu().numpy()
      preds = preds.detach().cpu().numpy()
      mss = []
      for i in range(preds.shape[0]):
          ms = []
          for j in range(preds.shape[1]):
              metric = speechmetrics_sisdr(
                  preds[i, j], target[i, j], rate=16000
              )
              ms.append(metric["sisdr"][0])
          mss.append(ms)
      return torch.tensor(mss)
  
file_path: torchmetrics/tests/unittests/audio/test_si_sdr.py
imports: from functools import partial
  import pytest
  import speechmetrics
  import torch
  from torch import Tensor
  from torchmetrics.audio import ScaleInvariantSignalDistortionRatio
  from torchmetrics.functional.audio import scale_invariant_signal_distortion_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 1 for calling a global function with example usage: _speechmetrics_si_sdr(preds, target, zero_mean) and returns: torch