提交 f2282996 编写于 作者: T tangwei

add save model to proto util

上级 47a1a003
......@@ -16,9 +16,20 @@ import os
import time
import datetime
from paddle import fluid
from fleetrec.core.utils import fs as fs
def save_program_proto(path, program=None):
if program is None:
_program = fluid.default_main_program()
else:
_program = program
with open(path, "wb") as f:
f.write(_program.desc.serialize_to_string())
def str2bool(v):
if isinstance(v, bool):
return v
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册