| 26 | # for overriding pytorch's save/load state_dict for zero3 |
| 27 | _EXTRA_STATE_KEY_SUFFIX = '_extra_state' # pytorch default name |
| 28 | class _IncompatibleKeys(namedtuple('IncompatibleKeys', ['missing_keys', 'unexpected_keys'])): |
| 29 | def __repr__(self): |
| 30 | if not self.missing_keys and not self.unexpected_keys: |
| 31 | return '<All keys matched successfully>' |
| 32 | return super().__repr__() |
| 33 | __str__ = __repr__ |
| 34 | |
| 35 | |
| 36 | def get_checkpoint_name(checkpoints_path, iteration, release=False, zero=False, use_ema=False): |
no outgoing calls
no test coverage detected