MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle / _save

Method _save

python/paddle/hapi/model.py:780–788  ·  view source on GitHub ↗
(state, path)

Source from the content-addressed store, hash-verified

778
779 def save(self, path):
780 def _save(state, path):
781 if not state:
782 return
783 state = {
784 k: to_numpy(v) if isinstance(v, Variable) else v
785 for k, v in state.items()
786 }
787 with open(path, 'wb') as f:
788 pickle.dump(state, f)
789
790 base = os.path.basename(path)
791 assert base != "", "path should be of 'dirname/filename' format"

Callers

nothing calls this directly

Calls 3

dumpMethod · 0.80
to_numpyFunction · 0.70
itemsMethod · 0.45

Tested by

no test coverage detected