def _get_checkpoint_state(self): state = self.get_checkpoint_state() d = cntk_py.Dictionary() for key, val in state.items(): if not is_string(key): raise ValueError('the keys of the checkpoint dictionary must ' 'be strings. You gave "%s" of type %s' % (key, type(key))) dv = cntk_py.DictionaryValue(val) d.add(key, dv) return d