class_docstr: TensorBoardStatsHandler defines a set of Ignite Event-handlers for all the TensorBoard logics.
  It can be used for any Ignite Engine(trainer, validator and evaluator).
  And it can support both epoch level and iteration level with pre-defined TensorBoard event writer.
  The expected data source is Ignite ``engine.state.output`` and ``engine.state.metrics``.
  
  Default behaviors:
      - When EPOCH_COMPLETED, write each dictionary item in
        ``engine.state.metrics`` to TensorBoard.
      - When ITERATION_COMPLETED, write each dictionary item in
        ``self.output_transform(engine.state.output)`` to TensorBoard.
  
  Usage example is available in the tutorial:
  https://github.com/Project-MONAI/tutorials/blob/master/3d_segmentation/unet_segmentation_3d_ignite.ipynb.
class_docstr_tok: ["TensorBoardStatsHandler","defines","a","set","of","Ignite","Event-handlers","for","all","the","TensorBoard","logics",".","It","can","be","used","for","any","Ignite","Engine","(","trainer",",","validator","and","evaluator",")",".","And","it","can","support","both","epoch","level","and","iteration","level","with","pre-defined","TensorBoard","event","writer",".","The","expected","data","source","is","Ignite","``","engine.state.output","``","and","``","engine.state.metrics","``",".","Default","behaviors",":","-","When","EPOCH_COMPLETED",",","write","each","dictionary","item","in","``","engine.state.metrics","``","to","TensorBoard",".","-","When","ITERATION_COMPLETED",",","write","each","dictionary","item","in","``","self.output_transform","(","engine.state.output",")","``","to","TensorBoard",".","Usage","example","is","available","in","the","tutorial",":","https",":","\/\/github.com\/Project-MONAI\/tutorials\/blob\/master\/3d_segmentation\/unet_segmentation_3d_ignite.ipynb","."]
docstr: Handler for train or validation/evaluation epoch completed Event.
  Write epoch level events, default values are from Ignite `engine.state.metrics` dict.
  
  Args:
      engine: Ignite Engine, it can be a trainer, validator or evaluator.
docstr_tok: ["Handler","for","train","or","validation\/evaluation","epoch","completed","Event",".","Write","epoch","level","events",",","default","values","are","from","Ignite","`","engine.state.metrics","`","dict",".","Args",":","engine",":","Ignite","Engine",",","it","can","be","a","trainer",",","validator","or","evaluator","."]
code: def epoch_completed(self, engine: Engine) -> None:
      """
      Handler for train or validation/evaluation epoch completed Event.
      Write epoch level events, default values are from Ignite `engine.state.metrics` dict.
  
      Args:
          engine: Ignite Engine, it can be a trainer, validator or evaluator.
  
      """
      if self.epoch_event_writer is not None:
          self.epoch_event_writer(engine, self._writer)
      else:
          self._default_epoch_writer(engine, self._writer)
  
imports: from __future__ import annotations
  import warnings
  from collections.abc import Callable, Sequence
  from typing import TYPE_CHECKING, Any
  import numpy
  import torch
  from monai.config import IgniteInfo
  from monai.utils import is_scalar, min_version, optional_import
  from monai.visualize import plot_2d_or_3d_image
label_desc: Use image node_id 3 for calling the TensorBoardStatsHandler obj's underlying member method code with example usage: obj.epoch_completed(engine) without return types