code: def _eval(model, data_loader, device):
      results = torch.zeros(4)
      with torch.no_grad():
          for _, batch in enumerate(data_loader):
              mix, src, mask = batch
              mix, src, mask = (
                  mix.to(device),
                  src.to(device),
                  mask.to(device),
              )
              est = model(mix)
              sisdri = sisdri_metric(est, src, mix, mask)
              src = src.cpu().detach().numpy()
              est = est.cpu().detach().numpy()
              mix = (
                  mix.repeat(1, src.shape[1], 1).cpu().detach().numpy()
              )
              sdr, sir, sar, _ = mir_eval.separation.bss_eval_sources(
                  src[0], est[0]
              )
              (
                  sdr_mix,
                  sir_mix,
                  sar_mix,
                  _,
              ) = mir_eval.separation.bss_eval_sources(src[0], mix[0])
              results += torch.tensor(
                  [
                      sdr.mean() - sdr_mix.mean(),
                      sisdri,
                      sir.mean() - sir_mix.mean(),
                      sar.mean() - sar_mix.mean(),
                  ]
              )
      results /= len(data_loader)
      print("SDR improvement: ", results[0].item())
      print("Si-SDR improvement: ", results[1].item())
      print("SIR improvement: ", results[2].item())
      print("SAR improvement: ", results[3].item())
  
imports: from argparse import ArgumentParser
  from pathlib import Path
  import mir_eval
  import torch
  from lightning_train import _get_dataloader, _get_model, sisdri_metric
label_desc: Use image node_id 1 for calling a global function with example usage: _eval(model, data_loader, device) without return types