class_docstr: Test class for `SpatialDistortionIndex` metric.
class_docstr_tok: ["Test","class","for","`","SpatialDistortionIndex","`","metric","."]
docstr: Test functional implementation of metric.
docstr_tok: ["Test","functional","implementation","of","metric","."]
code: def test_d_s_functional(
      self, preds, target, ms, pan, pan_lr, norm_order, window_size
  ):
      """Test functional implementation of metric."""
      self.run_functional_metric_test(
          preds,
          ms,
          spatial_distortion_index,
          partial(
              _np_d_s, norm_order=norm_order, window_size=window_size
          ),
          metric_args={
              "norm_order": norm_order,
              "window_size": window_size,
          },
          fragment_kwargs=True,
          pan=pan,
          pan_lr=pan_lr,
      )
  
imports: from functools import partial
  from typing import Dict, List, NamedTuple
  import numpy
  import pytest
  import torch
  from scipy.ndimage import uniform_filter
  from skimage.transform import resize
  from torch import Tensor
  from torchmetrics.functional.image.d_s import spatial_distortion_index
  from torchmetrics.functional.image.uqi import universal_image_quality_index
  from torchmetrics.image.d_s import SpatialDistortionIndex
  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 the TestSpatialDistortionIndex obj's underlying member method code with example usage: obj.test_d_s_functional(preds, target, ms, pan, pan_lr, norm_order, window_size) without return types