code: def multiscale_structural_similarity_index_measure(
      preds: Tensor,
      target: Tensor,
      gaussian_kernel: bool = True,
      sigma: Union[float, Sequence[float]] = 1.5,
      kernel_size: Union[int, Sequence[int]] = 11,
      reduction: Literal[
          "elementwise_mean", "sum", "none", None
      ] = "elementwise_mean",
      data_range: Optional[Union[float, Tuple[float, float]]] = None,
      k1: float = 0.01,
      k2: float = 0.03,
      betas: Tuple[float, ...] = (
          0.0448,
          0.2856,
          0.3001,
          0.2363,
          0.1333,
      ),
      normalize: Optional[Literal["relu", "simple"]] = "relu",
  ) -> Tensor:
      """Compute `MultiScaleSSIM`_, Multi-scale Structural Similarity Index Measure.
  
      This metric is a generalization of Structural Similarity Index Measure by incorporating image details at different
      resolution scores.
  
      Args:
          preds: Predictions from model of shape ``[N, C, H, W]``
          target: Ground truth values of shape ``[N, C, H, W]``
          gaussian_kernel: If true, a gaussian kernel is used, if false a uniform kernel is used
          sigma: Standard deviation of the gaussian kernel
          kernel_size: size of the gaussian kernel
          reduction: a method to reduce metric score over labels.
  
              - ``'elementwise_mean'``: takes the mean
              - ``'sum'``: takes the sum
              - ``'none'`` or ``None``: no reduction will be applied
  
          data_range:
              the range of the data. If None, it is determined from the data (max - min). If a tuple is provided then
              the range is calculated as the difference and input is clamped between the values.
          k1: Parameter of structural similarity index measure.
          k2: Parameter of structural similarity index measure.
          betas: Exponent parameters for individual similarities and contrastive sensitivities returned by different image
              resolutions.
          normalize: When MultiScaleSSIM loss is used for training, it is desirable to use normalizes to improve the
              training stability. This `normalize` argument is out of scope of the original implementation [1], and it is
              adapted from https://github.com/jorge-pessoa/pytorch-msssim instead.
  
      Return:
          Tensor with Multi-Scale SSIM score
  
      Raises:
          TypeError:
              If ``preds`` and ``target`` don't have the same data type.
          ValueError:
              If ``preds`` and ``target`` don't have ``BxCxHxW shape``.
          ValueError:
              If the length of ``kernel_size`` or ``sigma`` is not ``2``.
          ValueError:
              If one of the elements of ``kernel_size`` is not an ``odd positive number``.
          ValueError:
              If one of the elements of ``sigma`` is not a ``positive number``.
  
      Example:
          >>> from torchmetrics.functional.image import multiscale_structural_similarity_index_measure
          >>> gen = torch.manual_seed(42)
          >>> preds = torch.rand([3, 3, 256, 256], generator=gen)
          >>> target = preds * 0.75
          >>> multiscale_structural_similarity_index_measure(preds, target, data_range=1.0)
          tensor(0.9627)
  
      References:
          [1] Multi-Scale Structural Similarity For Image Quality Assessment by Zhou Wang, Eero P. Simoncelli and Alan C.
          Bovik `MultiScaleSSIM`_
  
      """
      if not isinstance(betas, tuple):
          raise ValueError(
              "Argument `betas` is expected to be of a type tuple."
          )
      if isinstance(betas, tuple) and not all(
          isinstance(beta, float) for beta in betas
      ):
          raise ValueError(
              "Argument `betas` is expected to be a tuple of floats."
          )
      if normalize and normalize not in ("relu", "simple"):
          raise ValueError(
              "Argument `normalize` to be expected either `None` or one of 'relu' or 'simple'"
          )
  
      preds, target = _ssim_check_inputs(preds, target)
      mcs_per_image = _multiscale_ssim_update(
          preds,
          target,
          gaussian_kernel,
          sigma,
          kernel_size,
          data_range,
          k1,
          k2,
          betas,
          normalize,
      )
      return _multiscale_ssim_compute(mcs_per_image, reduction)
  
file_path: torchmetrics/src/torchmetrics/functional/image/ssim.py
imports: from typing import List, Optional, Sequence, Tuple, Union
  import torch
  from torch import Tensor
  from torch.nn import functional
  from typing_extensions import Literal
  from torchmetrics.functional.image.helper import _gaussian_kernel_2d, _gaussian_kernel_3d, _reflection_pad_3d
  from torchmetrics.utilities.checks import _check_same_shape
  from torchmetrics.utilities.distributed import reduce
label_desc: Use image node_id 8 for calling a global function with example usage: multiscale_structural_similarity_index_measure(preds, target, gaussian_kernel, sigma, kernel_size, reduction, data_range, k1, k2, betas, normalize) and returns: _multiscale_ssim_compute