class_docstr: Event handler triggered on completing every iteration to save the classification predictions as CSV file.
  If running in distributed data parallel, only saves CSV file in the specified rank.
class_docstr_tok: ["Event","handler","triggered","on","completing","every","iteration","to","save","the","classification","predictions","as","CSV","file",".","If","running","in","distributed","data","parallel",",","only","saves","CSV","file","in","the","specified","rank","."]
docstr: Args:
      engine: Ignite Engine, it can be a trainer, validator or evaluator.
docstr_tok: ["Args",":","engine",":","Ignite","Engine",",","it","can","be","a","trainer",",","validator","or","evaluator","."]
code: def attach(self, engine: Engine) -> None:
      """
      Args:
          engine: Ignite Engine, it can be a trainer, validator or evaluator.
      """
      if self._name is None:
          self.logger = engine.logger
      if not engine.has_event_handler(
          self._started, Events.EPOCH_STARTED
      ):
          engine.add_event_handler(Events.EPOCH_STARTED, self._started)
      if not engine.has_event_handler(self, Events.ITERATION_COMPLETED):
          engine.add_event_handler(Events.ITERATION_COMPLETED, self)
      if not engine.has_event_handler(
          self._finalize, Events.EPOCH_COMPLETED
      ):
          engine.add_event_handler(
              Events.EPOCH_COMPLETED, self._finalize
          )
  
file_path: MONAI/monai/handlers/classification_saver.py
imports: from __future__ import annotations
  import logging
  import warnings
  from collections.abc import Callable
  from typing import TYPE_CHECKING
  import torch
  from monai.config import IgniteInfo
  from monai.data import CSVSaver, decollate_batch
  from monai.utils import ImageMetaKey
  from monai.utils import evenly_divisible_all_gather, min_version, optional_import, string_list_all_gather
label_desc: Use image node_id 2 for calling the ClassificationSaver obj's underlying member method code with example usage: obj.attach(engine) without return types