code: def test_reset_called_correctly():
      """Check that underlying metric is being correctly reset when calling forward."""
      base_metric = ConfusionMatrix(task="multiclass", num_classes=2)
      cf = MultioutputWrapper(base_metric, num_outputs=2)
  
      res = cf(tensor([[0, 0]]), tensor([[0, 0]]))
      assert torch.allclose(res[0], tensor([[1, 0], [0, 0]]))
      assert torch.allclose(res[1], tensor([[1, 0], [0, 0]]))
      cf.reset()
      res = cf(tensor([[1, 1]]), tensor([[0, 0]]))
      assert torch.allclose(res[0], tensor([[0, 1], [0, 0]]))
      assert torch.allclose(res[1], tensor([[0, 1], [0, 0]]))
  
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 3 for calling a global function with example usage: test_reset_called_correctly() without return types