class_docstr: Compute `spearmans rank correlation coefficient`_.
  
  .. math:
      r_s = = \frac{cov(rg_x, rg_y)}{\sigma_{rg_x} * \sigma_{rg_y}}
  
  where :math:`rg_x` and :math:`rg_y` are the rank associated to the variables :math:`x` and :math:`y`.
  Spearmans correlations coefficient corresponds to the standard pearsons correlation coefficient calculated
  on the rank variables.
  
  As input to ``forward`` and ``update`` the metric accepts the following input:
  
  - ``preds`` (:class:`~torch.Tensor`): Predictions from model in float tensor with shape ``(N,d)``
  - ``target`` (:class:`~torch.Tensor`): Ground truth values in float tensor with shape ``(N,d)``
  
  As output of ``forward`` and ``compute`` the metric returns the following output:
  
  - ``spearman`` (:class:`~torch.Tensor`): A tensor with the spearman correlation(s)
  
  Args:
      num_outputs: Number of outputs in multioutput setting
      kwargs: Additional keyword arguments, see :ref:`Metric kwargs` for more info.
  
  Example (single output regression):
      >>> from torch import tensor
      >>> from torchmetrics.regression import SpearmanCorrCoef
      >>> target = tensor([3, -0.5, 2, 7])
      >>> preds = tensor([2.5, 0.0, 2, 8])
      >>> spearman = SpearmanCorrCoef()
      >>> spearman(preds, target)
      tensor(1.0000)
  
  Example (multi output regression):
      >>> from torchmetrics.regression import SpearmanCorrCoef
      >>> target = tensor([[3, -0.5], [2, 7]])
      >>> preds = tensor([[2.5, 0.0], [2, 8]])
      >>> spearman = SpearmanCorrCoef(num_outputs=2)
      >>> spearman(preds, target)
      tensor([1.0000, 1.0000])
docstr: Compute Spearman's correlation coefficient.
docstr_tok: ["Compute","Spearman","'s","correlation","coefficient","."]
code: def compute(self) -> Tensor:
      """Compute Spearman's correlation coefficient."""
      preds = dim_zero_cat(self.preds)
      target = dim_zero_cat(self.target)
      return _spearman_corrcoef_compute(preds, target)
  
file_path: torchmetrics/src/torchmetrics/regression/spearman.py
imports: from typing import Any, List, Optional, Sequence, Union
  from torch import Tensor
  from torchmetrics.functional.regression.spearman import _spearman_corrcoef_compute, _spearman_corrcoef_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 SpearmanCorrCoef obj's underlying member method code with example usage: obj.compute() and returns: _spearman_corrcoef_compute