class_docstr: Test class for `PearsonCorrCoef` metric.
class_docstr_tok: ["Test","class","for","`","PearsonCorrCoef","`","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_pearson_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(
              PearsonCorrCoef, num_outputs=num_outputs
          ),
          metric_functional=pearson_corrcoef,
      )
  
imports: from functools import partial
  import pytest
  import torch
  from scipy.stats import pearsonr
  from torchmetrics.functional.regression.pearson import pearson_corrcoef
  from torchmetrics.regression.pearson import PearsonCorrCoef, _final_aggregation
  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 TestPearsonCorrCoef obj's underlying member method code with example usage: obj.test_pearson_corrcoef_differentiability(preds, target) without return types