class_docstr: Test class that allows passing base metric as a class rather than its instantiation to the wrapper.
class_docstr_tok: ["Test","class","that","allows","passing","base","metric","as","a","class","rather","than","its","instantiation","to","the","wrapper","."]
code: def __init__(
      self,
      base_metric_class,
      num_outputs: int = 1,
      **kwargs: Any,
  ) -> None:
      super().__init__(**kwargs)
      self.metric = MultioutputWrapper(
          base_metric_class(**kwargs),
          num_outputs=num_outputs,
      )
  
imports: from functools import partial
  from typing import Any
  import pytest
  import torch
  from sklearn.metrics import accuracy_score
  from sklearn.metrics import r2_score
  from torch import Tensor, tensor
  from torchmetrics import Metric
  from torchmetrics.classification import ConfusionMatrix, MulticlassAccuracy
  from torchmetrics.regression import R2Score
  from torchmetrics.wrappers.multioutput import MultioutputWrapper
  from unittests import BATCH_SIZE, NUM_BATCHES, NUM_CLASSES, _Input
  from unittests.helpers import seed_all
  from unittests.helpers.testers import MetricTester
label_desc: Use image node_id 1 to create a new _MultioutputMetric object from inherited base classes: Metric with example: obj = _MultioutputMetric(base_metric_class, num_outputs)