class_docstr: Test class for `SpearmanCorrCoef` metric.
class_docstr_tok: ["Test","class","for","`","SpearmanCorrCoef","`","metric","."]
docstr: Test the differentiability of the metric, according to its `is_differentiable` attribute.
docstr_tok: ["Test","the","differentiability","of","the","metric",",","according","to","its","`","is_differentiable","`","attribute","."]
code: def test_spearman_corrcoef_differentiability(self, preds, target):
      """Test the differentiability of the metric, according to its `is_differentiable` attribute."""
      num_outputs = EXTRA_DIM if preds.ndim == 3 else 1
      self.run_differentiability_test(
          preds=preds,
          target=target,
          metric_module=partial(
              SpearmanCorrCoef, num_outputs=num_outputs
          ),
          metric_functional=spearman_corrcoef,
      )
  
file_path: torchmetrics/tests/unittests/regression/test_spearman.py
imports: from functools import partial
  import pytest
  import torch
  from scipy.stats import rankdata, spearmanr
  from torchmetrics.functional.regression.spearman import _rank_data, spearman_corrcoef
  from torchmetrics.regression.spearman import SpearmanCorrCoef
  from torchmetrics.utilities.imports import _TORCH_GREATER_EQUAL_2_1
  from unittests import BATCH_SIZE, EXTRA_DIM, NUM_BATCHES, _Input
  from unittests.helpers import seed_all
  from unittests.helpers.testers import MetricTester
label_desc: Use image node_id 3 for calling the TestSpearmanCorrCoef obj's underlying member method code with example usage: obj.test_spearman_corrcoef_differentiability(preds, target) without return types