code: def test_reduction(self):
      hd_metric = HausdorffDistance(
          include_background=True, reduction="mean_channel"
      )
  
      def _val_func(engine, batch):
          pass
  
      engine = Engine(_val_func)
      hd_metric.attach(engine, "hausdorff_distance")
  
      y_pred, y = TEST_SAMPLE_1
      hd_metric.update([y_pred, y])
      y_pred, y = TEST_SAMPLE_2
      hd_metric.update([y_pred, y])
      assert_allclose(
          hd_metric.compute().float(), torch.tensor([10.0, 0.0])
      )
  
file_path: MONAI/tests/test_handler_hausdorff_distance.py
imports: from __future__ import annotations
  import unittest
  import numpy
  import torch
  from ignite.engine import Engine
  from monai.handlers import HausdorffDistance
  from tests.utils import assert_allclose
label_desc: Use image node_id 3 for calling the TestHandlerHausdorffDistance obj's underlying member method code with example usage: obj.test_reduction() without return types