MCPcopy Create free account
hub / github.com/baidu/DDParser / save

Function save

ddparser/parser/model.py:246–251  ·  view source on GitHub ↗

Saving model

(path, args, model, optimizer)

Source from the content-addressed store, hash-verified

244
245
246def save(path, args, model, optimizer):
247 """Saving model"""
248 fluid.save_dygraph(model.state_dict(), path)
249 fluid.save_dygraph(optimizer.state_dict(), path)
250 with open(path + ".args", "wb") as f:
251 pickle.dump(args.namespace, f, protocol=2)
252
253
254def load(path, model=None, mode="evaluate"):

Callers 1

trainFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected