code: def test_compute(self):
      auc_metric = ROCAUC()
      act = Activations(softmax=True)
      to_onehot = AsDiscrete(to_onehot=2)
  
      y_pred = [torch.Tensor([0.1, 0.9]), torch.Tensor([0.3, 1.4])]
      y = [torch.Tensor([0]), torch.Tensor([1])]
      y_pred = [act(p) for p in y_pred]
      y = [to_onehot(y_) for y_ in y]
      auc_metric.update([y_pred, y])
  
      y_pred = [torch.Tensor([0.2, 0.1]), torch.Tensor([0.1, 0.5])]
      y = [torch.Tensor([0]), torch.Tensor([1])]
      y_pred = [act(p) for p in y_pred]
      y = [to_onehot(y_) for y_ in y]
  
      auc_metric.update([y_pred, y])
  
      auc = auc_metric.compute()
      np.testing.assert_allclose(0.75, auc)
  
file_path: MONAI/tests/test_handler_rocauc.py
imports: from __future__ import annotations
  import unittest
  import numpy
  import torch
  from monai.handlers import ROCAUC
  from monai.transforms import Activations, AsDiscrete
label_desc: Use image node_id 1 for calling the TestHandlerROCAUC obj's underlying member method code with example usage: obj.test_compute() without return types