class_docstr: Test the MultioutputWrapper class with regression and classification inner metrics.
class_docstr_tok: ["Test","the","MultioutputWrapper","class","with","regression","and","classification","inner","metrics","."]
docstr: Test correctness of implementation.
  
  Tests that the multioutput wrapper properly slices and computes outputs along the output dimension for both
  classification and regression metrics, by comparing to the metric if they had been calculated sequentially.
docstr_tok: ["Test","correctness","of","implementation",".","Tests","that","the","multioutput","wrapper","properly","slices","and","computes","outputs","along","the","output","dimension","for","both","classification","and","regression","metrics",",","by","comparing","to","the","metric","if","they","had","been","calculated","sequentially","."]
code: def test_multioutput_wrapper(
      self,
      base_metric_class,
      compare_metric,
      preds,
      target,
      num_outputs,
      ddp,
  ):
      """Test correctness of implementation.
  
      Tests that the multioutput wrapper properly slices and computes outputs along the output dimension for both
      classification and regression metrics, by comparing to the metric if they had been calculated sequentially.
  
      """
      self.run_class_metric_test(
          ddp,
          preds,
          target,
          _MultioutputMetric,
          compare_metric,
          metric_args={
              "num_outputs": num_outputs,
              "base_metric_class": base_metric_class,
          },
      )
  
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 for calling the TestMultioutputWrapper obj's underlying member method code with example usage: obj.test_multioutput_wrapper(base_metric_class, compare_metric, preds, target, num_outputs, ddp) without return types