class_docstr: Test class for `ExplainedVariance` metric.
class_docstr_tok: ["Test","class","for","`","ExplainedVariance","`","metric","."]
docstr: Test class implementation of metric.
docstr_tok: ["Test","class","implementation","of","metric","."]
code: def test_explained_variance(
      self, multioutput, preds, target, ref_metric, ddp
  ):
      """Test class implementation of metric."""
      self.run_class_metric_test(
          ddp,
          preds,
          target,
          ExplainedVariance,
          partial(
              ref_metric,
              sk_fn=partial(
                  explained_variance_score, multioutput=multioutput
              ),
          ),
          metric_args={"multioutput": multioutput},
      )
  
file_path: torchmetrics/tests/unittests/regression/test_explained_variance.py
imports: from functools import partial
  import pytest
  import torch
  from sklearn.metrics import explained_variance_score
  from torchmetrics.functional import explained_variance
  from torchmetrics.regression import ExplainedVariance
  from unittests import BATCH_SIZE, 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 TestExplainedVariance obj's underlying member method code with example usage: obj.test_explained_variance(multioutput, preds, target, ref_metric, ddp) without return types