code: def test_tb_image_shape(self, shape):
      with tempfile.TemporaryDirectory() as tempdir:
          # set up engine
          def _train_func(engine, batch):
              engine.state.batch = decollate_batch(list(batch))
              return [torch.zeros((1, 10, 10))]
  
          engine = Engine(_train_func)
  
          # set up testing handler
          stats_handler = TensorBoardImageHandler(log_dir=tempdir)
          engine.add_event_handler(
              Events.ITERATION_COMPLETED, stats_handler
          )
  
          data = zip(
              torch.as_tensor(np.random.normal(size=(10, 4, *shape))),
              torch.as_tensor(np.random.normal(size=(10, 4, *shape))),
          )
          engine.run(data, epoch_length=10, max_epochs=1)
          stats_handler.close()
  
          self.assertTrue(len(glob.glob(tempdir)) > 0)
  
file_path: MONAI/tests/test_handler_tb_image.py
imports: from __future__ import annotations
  import glob
  import tempfile
  import unittest
  import numpy
  import torch
  from ignite.engine import Engine, Events
  from parameterized import parameterized
  from monai.data import decollate_batch
  from monai.handlers import TensorBoardImageHandler
  from monai.utils import optional_import
  from tests.utils import SkipIfBeforePyTorchVersion
label_desc: Use image node_id 1 for calling the TestHandlerTBImage obj's underlying member method code with example usage: obj.test_tb_image_shape(shape) and returns: list