code: def _sewar_vif(preds, target, sigma_nsq=2):
      preds = torch.movedim(preds, 1, -1)
      target = torch.movedim(target, 1, -1)
      preds = preds.cpu().numpy()
      target = target.cpu().numpy()
      vif = [
          vifp(GT=target[batch], P=preds[batch], sigma_nsq=sigma_nsq)
          for batch in range(preds.shape[0])
      ]
      return np.mean(vif)
  
file_path: torchmetrics/tests/unittests/image/test_vif.py
imports: import numpy
  import pytest
  import torch
  from sewar.full_ref import vifp
  from torchmetrics.functional.image.vif import visual_information_fidelity
  from torchmetrics.image.vif import VisualInformationFidelity
  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: _sewar_vif(preds, target, sigma_nsq) and returns: np