class_docstr: An object that is used to pass internal and user-defined state between event handlers. By default, state
  contains the following attributes:
  
  .. code-block:: python
  
      state.iteration         # 1-based, the first iteration is 1
      state.epoch             # 1-based, the first epoch is 1
      state.seed              # seed to set at each epoch
      state.dataloader        # data passed to engine
      state.epoch_length      # optional length of an epoch
      state.max_epochs        # number of epochs to run
      state.max_iters         # number of iterations to run
      state.batch             # batch passed to `process_function`
      state.output            # output of `process_function` after a single iteration
      state.metrics           # dictionary with defined metrics if any
      state.times             # dictionary with total and per-epoch times fetched on
                              # keys: Events.EPOCH_COMPLETED.name and Events.COMPLETED.name
  
  Args:
      kwargs: keyword arguments to be defined as State attributes.
class_docstr_tok: ["An","object","that","is","used","to","pass","internal","and","user-defined","state","between","event","handlers",".","By","default",",","state","contains","the","following","attributes",":","..","code-block",":",":","python","state.iteration","#","1-based",",","the","first","iteration","is","1","state.epoch","#","1-based",",","the","first","epoch","is","1","state.seed","#","seed","to","set","at","each","epoch","state.dataloader","#","data","passed","to","engine","state.epoch_length","#","optional","length","of","an","epoch","state.max_epochs","#","number","of","epochs","to","run","state.max_iters","#","number","of","iterations","to","run","state.batch","#","batch","passed","to","`","process_function","`","state.output","#","output","of","`","process_function","`","after","a","single","iteration","state.metrics","#","dictionary","with","defined","metrics","if","any","state.times","#","dictionary","with","total","and","per-epoch","times","fetched","on","#","keys",":","Events.EPOCH_COMPLETED.name","and","Events.COMPLETED.name","Args",":","kwargs",":","keyword","arguments","to","be","defined","as","State","attributes","."]
code: def __init__(self, **kwargs: Any) -> None:
      self.iteration = 0
      self.epoch = 0
      self.epoch_length: Optional[int] = None
      self.max_epochs: Optional[int] = None
      self.max_iters: Optional[int] = None
      self.output: Optional[int] = None
      self.batch: Optional[int] = None
      self.metrics: Dict[str, Any] = {}
      self.dataloader: Optional[Union[DataLoader, Iterable[Any]]] = None
      self.seed: Optional[int] = None
      self.times: Dict[str, Optional[float]] = {
          Events.EPOCH_COMPLETED.name: None,
          Events.COMPLETED.name: None,
      }
  
      for k, v in kwargs.items():
          setattr(self, k, v)
  
      self._update_attrs()
  
imports: import numbers
  import warnings
  import weakref
  from collections.abc import Sequence
  from enum import Enum
  from types import DynamicClassAttribute
  from typing import Any, Callable, Dict, Iterable, Iterator, List, Optional, TYPE_CHECKING, Union
  from torch.utils.data import DataLoader
  from ignite.engine.utils import _check_signature
label_desc: Use image node_id 1 to create a new State object  with example: obj = State()