class_docstr: A mixin to track modules, optimizers, and LR schedulers to simplify checkpointing object states.
  This can be easily extended to cover types that conform to the Stateful protocol.
  The logic here is adapted from torch.nn.Module's handling to register states for buffers, parameters, and modules.
class_docstr_tok: ["A","mixin","to","track","modules",",","optimizers",",","and","LR","schedulers","to","simplify","checkpointing","object","states",".","This","can","be","easily","extended","to","cover","types","that","conform","to","the","Stateful","protocol",".","The","logic","here","is","adapted","from","torch.nn.Module","'s","handling","to","register","states","for","buffers",",","parameters",",","and","modules","."]
docstr: Join together all of the tracked stateful entities to simplify registration of snapshottable states
docstr_tok: ["Join","together","all","of","the","tracked","stateful","entities","to","simplify","registration","of","snapshottable","states"]
code: def app_state(self) -> Dict[str, Any]:
      """Join together all of the tracked stateful entities to simplify registration of snapshottable states"""
      # TODO: refine with Stateful typehint
      # TODO: Should we split this into app_state_to_load and app_state_to_save
      # in order to let users customize the saving & loading paths independently?
      # or should we assume this is done outside of the loop framework entirely?
      app_state = {
          **self.tracked_modules(),
          **self.tracked_optimizers(),
          **self.tracked_lr_schedulers(),
          **self.tracked_progress(),
          **self.tracked_misc_statefuls(),
      }
      return app_state
  
imports: import logging
  from abc import ABC, abstractmethod
  from typing import Any, cast, Dict, Generic, Iterator, TypeVar, Union
  import torch
  from torchtnt.framework._loop_utils import _step_requires_iterator
  from torchtnt.framework._unit_utils import _find_optimizers_for_module
  from torchtnt.framework.state import State
  from torchtnt.utils.lr_scheduler import TLRScheduler
  from torchtnt.utils.prepare_module import _is_fsdp_module, FSDPOptimizerWrapper
  from torchtnt.utils.progress import Progress
  from torchtnt.utils.stateful import Stateful
label_desc: Use image node_id 2 for calling the AppStateMixin obj's underlying member method code with example usage: obj.app_state() and returns: app_state