code: def test_compute(self, input_params, decollate, expected):
      data = [
          {
              "image": torch.tensor([[[[2.0], [3.0]]]]),
              "filename": ["test1"],
          },
          {
              "image": torch.tensor([[[[6.0], [8.0]]]]),
              "filename": ["test2"],
          },
      ]
      # set up engine, PostProcessing handler works together with postprocessing transforms of engine
      engine = SupervisedEvaluator(
          device=torch.device("cpu:0"),
          val_data_loader=data,
          epoch_length=2,
          network=torch.nn.PReLU(),
          postprocessing=Compose(
              [Activationsd(keys="pred", sigmoid=True)]
          ),
          val_handlers=[PostProcessing(**input_params)],
          decollate=decollate,
      )
      engine.run()
  
      if isinstance(engine.state.output, list):
          # test decollated list items
          for o, e in zip(engine.state.output, expected):
              assert_allclose(
                  o["pred"], e, atol=1e-4, rtol=1e-4, type_test=False
              )
              filename = o.get("filename_bak")
              if filename is not None:
                  self.assertEqual(filename, "test2")
      else:
          # test batch data
          assert_allclose(
              engine.state.output["pred"],
              expected,
              atol=1e-4,
              rtol=1e-4,
              type_test=False,
          )
  
file_path: MONAI/tests/test_handler_post_processing.py
imports: from __future__ import annotations
  import unittest
  import torch
  from parameterized import parameterized
  from monai.engines import SupervisedEvaluator
  from monai.handlers import PostProcessing
  from monai.transforms import Activationsd, AsDiscreted, Compose, CopyItemsd
  from tests.utils import assert_allclose
label_desc: Use image node_id 1 for calling the TestHandlerPostProcessing obj's underlying member method code with example usage: obj.test_compute(input_params, decollate, expected) without return types