MCPcopy Create free account
hub / github.com/PaddlePaddle/Research / save

Function save

NLP/Text2SQL-BASELINE/text2sql/io.py:53–70  ·  view source on GitHub ↗

Args: model (TYPE): NULL optimzer (TYPE): NULL save_path (TYPE): NULL Returns: TODO Raises: NULL

(model, optimzer, save_path)

Source from the content-addressed store, hash-verified

51
52
53def save(model, optimzer, save_path):
54 """
55
56 Args:
57 model (TYPE): NULL
58 optimzer (TYPE): NULL
59 save_path (TYPE): NULL
60
61 Returns: TODO
62
63 Raises: NULL
64 """
65 try:
66 paddle.save(model.state_dict(), save_path + '.pdparams')
67 paddle.save(optimzer.state_dict(), save_path + '.pdopt')
68 except Exception as e:
69 logging.error('save model and optimzer failed. save path: %s', save_path)
70 logging.error(traceback.format_exc())
71
72
73if __name__ == "__main__":

Callers

nothing calls this directly

Calls 2

saveMethod · 0.45
state_dictMethod · 0.45

Tested by

no test coverage detected