code: def test_d_s_invalid_type(ms, pan, pan_lr, match):
      """Test that error is raised on different dtypes."""
      preds_t = torch.rand((1, 1, 16, 16))
      with pytest.raises(TypeError, match=match):
          spatial_distortion_index(
              preds_t, ms, pan, pan_lr, norm_order=1, window_size=7
          )
  
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 5 for calling a global function with example usage: test_d_s_invalid_type(ms, pan, pan_lr, match) without return types