diff --git a/ignite/handlers/checkpoint.py b/ignite/handlers/checkpoint.py index dd20a8f69c55..21d6d14e589d 100644 --- a/ignite/handlers/checkpoint.py +++ b/ignite/handlers/checkpoint.py @@ -768,8 +768,8 @@ def state_dict(self) -> OrderedDict: """Method returns state dict with saved items: list of ``(priority, filename)`` pairs. Can be used to save internal state of the class. """ - # TODO: this method should use _state_dict_all_req_keys - return OrderedDict([("_saved", [(p, f) for p, f in self._saved])]) + keys = self._state_dict_all_req_keys + return OrderedDict([(k, [(p, f) for p, f in getattr(self, k)]) for k in keys]) def load_state_dict(self, state_dict: Mapping) -> None: """Method replaces internal state of the class with provided state dict data.