class_docstr: Compute Spectral Distortion Index (SpectralDistortionIndex_) also now as D_lambda.
  
  The metric is used to compare the spectral distortion between two images.
  
  As input to ``forward`` and ``update`` the metric accepts the following input
  
  - ``preds`` (:class:`~torch.Tensor`): Low resolution multispectral image of shape ``(N,C,H,W)``
  - ``target``(:class:`~torch.Tensor`): High resolution fused image of shape ``(N,C,H,W)``
  
  As output of `forward` and `compute` the metric returns the following output
  
  - ``sdi`` (:class:`~torch.Tensor`): if ``reduction!='none'`` returns float scalar tensor with average SDI value
    over sample else returns tensor of shape ``(N,)`` with SDI values per sample
  
  Args:
      p: Large spectral differences
      reduction: a method to reduce metric score over labels.
  
          - ``'elementwise_mean'``: takes the mean (default)
          - ``'sum'``: takes the sum
          - ``'none'``: no reduction will be applied
  
      kwargs: Additional keyword arguments, see :ref:`Metric kwargs` for more info.
  
  Example:
      >>> import torch
      >>> _ = torch.manual_seed(42)
      >>> from torchmetrics.image import SpectralDistortionIndex
      >>> preds = torch.rand([16, 3, 16, 16])
      >>> target = torch.rand([16, 3, 16, 16])
      >>> sdi = SpectralDistortionIndex()
      >>> sdi(preds, target)
      tensor(0.0234)
class_docstr_tok: ["Compute","Spectral","Distortion","Index","(","SpectralDistortionIndex_",")","also","now","as","D_lambda",".","The","metric","is","used","to","compare","the","spectral","distortion","between","two","images",".","As","input","to","``","forward","``","and","``","update","``","the","metric","accepts","the","following","input","-","``","preds","``","(",":","class",":","`","~torch.Tensor","`",")",":","Low","resolution","multispectral","image","of","shape","``","(","N",",","C",",","H",",","W",")","``","-","``","target","``","(",":","class",":","`","~torch.Tensor","`",")",":","High","resolution","fused","image","of","shape","``","(","N",",","C",",","H",",","W",")","``","As","output","of","`","forward","`","and","`","compute","`","the","metric","returns","the","following","output","-","``","sdi","``","(",":","class",":","`","~torch.Tensor","`",")",":","if","``","reduction","!","='none","'","``","returns","float","scalar","tensor","with","average","SDI","value","over","sample","else","returns","tensor","of","shape","``","(","N",",",")","``","with","SDI","values","per","sample","Args",":","p",":","Large","spectral","differences","reduction",":","a","method","to","reduce","metric","score","over","labels",".","-","``","'elementwise_mean","'","``",":","takes","the","mean","(","default",")","-","``","'sum","'","``",":","takes","the","sum","-","``","'none","'","``",":","no","reduction","will","be","applied","kwargs",":","Additional","keyword","arguments",",","see",":","ref",":","`","Metric","kwargs","`","for","more","info",".","Example",":",">",">",">","import","torch",">",">",">","_","=","torch.manual_seed","(","42",")",">",">",">","from","torchmetrics.image","import","SpectralDistortionIndex",">",">",">","preds","=","torch.rand","(","[","16",",","3",",","16",",","16","]",")",">",">",">","target","=","torch.rand","(","[","16",",","3",",","16",",","16","]",")",">",">",">","sdi","=","SpectralDistortionIndex","(",")",">",">",">","sdi","(","preds",",","target",")","tensor","(","0.0234",")"]
docstr: Compute and returns spectral distortion index.
docstr_tok: ["Compute","and","returns","spectral","distortion","index","."]
code: def compute(self) -> Tensor:
      """Compute and returns spectral distortion index."""
      preds = dim_zero_cat(self.preds)
      target = dim_zero_cat(self.target)
      return _spectral_distortion_index_compute(
          preds, target, self.p, self.reduction
      )
  
file_path: torchmetrics/src/torchmetrics/image/d_lambda.py
imports: from typing import Any, List, Optional, Sequence, Union
  from torch import Tensor
  from typing_extensions import Literal
  from torchmetrics.functional.image.d_lambda import _spectral_distortion_index_compute, _spectral_distortion_index_update
  from torchmetrics.metric import Metric
  from torchmetrics.utilities import rank_zero_warn
  from torchmetrics.utilities.data import dim_zero_cat
  from torchmetrics.utilities.imports import _MATPLOTLIB_AVAILABLE
  from torchmetrics.utilities.plot import _AX_TYPE, _PLOT_OUT_TYPE
label_desc: Use image node_id 3 for calling the SpectralDistortionIndex obj's underlying member method code with example usage: obj.compute() and returns: _spectral_distortion_index_compute