MCPcopy Create free account
hub / github.com/Oneflow-Inc/oneflow / _load_checkpoint

Method _load_checkpoint

python/oneflow/framework/model.py:573–577  ·  view source on GitHub ↗

Load model states from a checkpoint.

(self, dirpath: str)

Source from the content-addressed store, hash-verified

571 )
572
573 def _load_checkpoint(self, dirpath: str):
574 """Load model states from a checkpoint.
575 """
576 stat_dict = flow.load(path=dirpath)
577 self._model.load_state_dict(stat_dict)
578
579 def _save_checkpoint(self, dirpath: str):
580 """Save model states as a checkpoint.

Callers 1

loadMethod · 0.95

Calls 2

loadMethod · 0.45
load_state_dictMethod · 0.45

Tested by

no test coverage detected