Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Crayon鑫
Paddle
提交
af0a6a14
P
Paddle
项目概览
Crayon鑫
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
af0a6a14
编写于
6月 19, 2018
作者:
T
tangwei12
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
checkpoint notify
上级
ae12281d
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
29 addition
and
7 deletion
+29
-7
paddle/fluid/operators/detail/request_handler_impl.cc
paddle/fluid/operators/detail/request_handler_impl.cc
+2
-3
paddle/fluid/operators/save_op.cc
paddle/fluid/operators/save_op.cc
+26
-3
python/paddle/fluid/transpiler/distribute_transpiler.py
python/paddle/fluid/transpiler/distribute_transpiler.py
+1
-1
未找到文件。
paddle/fluid/operators/detail/request_handler_impl.cc
浏览文件 @
af0a6a14
...
...
@@ -126,11 +126,10 @@ bool RequestCheckpointHandler::Handle(const std::string& varname,
framework
::
Variable
**
outvar
,
const
std
::
string
&
out_var_name
)
{
auto
lt_varname
=
string
::
Sprintf
(
"%s.path"
,
varname
);
auto
*
lt_var
=
scope
->
FindVar
(
lt_varname
)
->
GetMutable
<
std
::
string
>
();
auto
*
lt_var
=
scope
->
FindVar
(
"loopup_table_path"
)
->
GetMutable
<
std
::
string
>
();
lt_var
->
clear
();
lt_var
->
append
(
out_var_name
);
VLOG
(
4
)
<<
"RequestCheckpointHandler update
"
<<
lt_varname
<<
"
to: "
<<
out_var_name
;
VLOG
(
4
)
<<
"RequestCheckpointHandler update
loopup_table_path
to: "
<<
out_var_name
;
executor_
->
RunPreparedContext
(
checkpoint_prepared_ctx_
.
get
(),
scope
);
return
true
;
}
...
...
paddle/fluid/operators/save_op.cc
浏览文件 @
af0a6a14
...
...
@@ -182,9 +182,32 @@ This operator will serialize and write a tensor/selected rows variable to file o
}
};
}
// namespace operators
}
// namespace paddle
class
SaveOpVarTypeInference
:
public
framework
::
VarTypeInference
{
public:
void
operator
()(
const
framework
::
OpDesc
&
op_desc
,
framework
::
BlockDesc
*
block
)
const
override
{
auto
out_var_name
=
op_desc
.
Output
(
"loopup_table_path"
).
front
();
auto
&
out_var
=
block
->
FindRecursiveOrCreateVar
(
out_var_name
);
auto
var_type
=
framework
::
proto
::
VarType
::
RAW
;
out_var
.
SetType
(
var_type
);
}
};
class
SaveOpShapeInference
:
public
framework
::
InferShapeBase
{
public:
void
operator
()(
framework
::
InferShapeContext
*
ctx
)
const
override
{}
};
}
}
// namespace operators
// namespace paddle
namespace
ops
=
paddle
::
operators
;
REGISTER_OPERATOR
(
save
,
ops
::
SaveOp
,
ops
::
SaveOpProtoMaker
);
REGISTER_OPERATOR
(
save
,
ops
::
SaveOp
,
paddle
::
framework
::
EmptyGradOpMaker
,
ops
::
SaveOpProtoMaker
,
ops
::
SaveOpVarTypeInference
,
ops
::
SaveOpShapeInference
);
python/paddle/fluid/transpiler/distribute_transpiler.py
浏览文件 @
af0a6a14
...
...
@@ -838,7 +838,7 @@ class DistributeTranspiler:
"""
import
os
pserver_program
.
global_block
().
create_var
(
name
=
"
%s.path"
%
self
.
table_name
,
persistable
=
True
,
type
=
core
.
VarDesc
.
VarType
.
RAW
)
pserver_program
.
global_block
().
create_var
(
name
=
"
loopup_table_path"
,
persistable
=
True
,
type
=
core
.
VarDesc
.
VarType
.
RAW
)
checkpoint_save_block
=
pserver_program
.
create_block
(
pre_block_idx
)
checkpoint_save_block
.
append_op
(
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录