class_docstr: Test class for `KendallRankCorrCoef` metric.
class_docstr_tok: ["Test","class","for","`","KendallRankCorrCoef","`","metric","."]
docstr: Test class implementation of metric.
docstr_tok: ["Test","class","implementation","of","metric","."]
code: def test_kendall_rank_corrcoef(
      self, preds, target, alternative, variant, ddp
  ):
      """Test class implementation of metric."""
      num_outputs = EXTRA_DIM if preds.ndim == 3 else 1
      t_test = bool(alternative is not None)
      _sk_kendall_tau = partial(
          _scipy_kendall, alternative=alternative, variant=variant
      )
      alternative = _adjust_alternative_to_scipy(alternative)
  
      self.run_class_metric_test(
          ddp,
          preds,
          target,
          KendallRankCorrCoef,
          _sk_kendall_tau,
          metric_args={
              "t_test": t_test,
              "alternative": alternative,
              "variant": variant,
              "num_outputs": num_outputs,
          },
      )
  
file_path: torchmetrics/tests/unittests/regression/test_kendall.py
imports: import operator
  import sys
  from functools import partial
  import pytest
  import torch
  from lightning_utilities.core.imports import compare_version
  from scipy.stats import kendalltau
  from torchmetrics.functional.regression.kendall import kendall_rank_corrcoef
  from torchmetrics.regression.kendall import KendallRankCorrCoef
  from torchmetrics.utilities.imports import _SCIPY_GREATER_EQUAL_1_8, _TORCH_LOWER_2_0
  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 1 for calling the TestKendallRankCorrCoef obj's underlying member method code with example usage: obj.test_kendall_rank_corrcoef(preds, target, alternative, variant, ddp) without return types