code: def _np_d_lambda(preds, target, p):
      c, h, w = preds.shape[-3:]
      np_preds = preds.view(-1, c, h, w).permute(0, 2, 3, 1).numpy()
      np_target = target.view(-1, c, h, w).permute(0, 2, 3, 1).numpy()
  
      return _baseline_d_lambda(
          np_preds,
          np_target,
          p=p,
      )
  
imports: from functools import partial
  from typing import NamedTuple
  import numpy
  import pytest
  import torch
  from torch import Tensor
  from torchmetrics.functional.image.d_lambda import spectral_distortion_index
  from torchmetrics.functional.image.uqi import universal_image_quality_index
  from torchmetrics.image.d_lambda import SpectralDistortionIndex
  from unittests import BATCH_SIZE, NUM_BATCHES
  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: _np_d_lambda(preds, target, p) and returns: _baseline_d_lambda