Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
9a7084c1
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2298
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
9a7084c1
编写于
8月 05, 2018
作者:
Q
qiaolongfei
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix test_dist_transpiler
上级
25ab4e0d
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
18 addition
and
9 deletion
+18
-9
paddle/fluid/CMakeLists.txt
paddle/fluid/CMakeLists.txt
+1
-1
python/paddle/fluid/tests/unittests/test_dist_transpiler.py
python/paddle/fluid/tests/unittests/test_dist_transpiler.py
+17
-8
未找到文件。
paddle/fluid/CMakeLists.txt
浏览文件 @
9a7084c1
...
...
@@ -6,4 +6,4 @@ add_subdirectory(pybind)
add_subdirectory
(
string
)
add_subdirectory
(
recordio
)
# NOTE: please add subdirectory inference at last.
add_subdirectory
(
inference
)
#
add_subdirectory(inference)
python/paddle/fluid/tests/unittests/test_dist_transpiler.py
浏览文件 @
9a7084c1
...
...
@@ -73,9 +73,18 @@ class TranspilerTest(unittest.TestCase):
return
self
.
transpiler
def
transpiler_test_impl
(
self
):
pass
class
TestBasicModel
(
TranspilerTest
):
def
test_transpiler
(
self
):
main
=
fluid
.
Program
()
startup
=
fluid
.
Program
()
with
fluid
.
program_guard
(
main
,
startup
):
self
.
transpiler_test_impl
()
class
TestBasicModel
(
TranspilerTest
):
def
transpiler_test_impl
(
self
):
pserver
,
startup
=
self
.
get_pserver
(
self
.
pserver1_ep
)
pserver2
,
startup2
=
self
.
get_pserver
(
self
.
pserver2_ep
)
...
...
@@ -123,7 +132,7 @@ class TestBasicModel(TranspilerTest):
class
TestBasicModelWithLargeBlockSize
(
TranspilerTest
):
def
t
est_transpiler
(
self
):
def
t
ranspiler_test_impl
(
self
):
config
=
fluid
.
DistributeTranspilerConfig
()
config
.
min_block_size
=
1048576
...
...
@@ -148,7 +157,7 @@ class TestBasicModelWithLargeBlockSize(TranspilerTest):
[
"sum"
,
"scale"
,
"sgd"
])
# confirm startup program
self
.
assertEqual
([
op
.
type
for
op
in
startup
.
global_block
().
ops
],
[
"fill_constant"
,
"fill_constant"
,
"fill_constant"
])
[
"fill_constant"
,
"fill_constant"
])
# the variable #fc_w will be split into two blocks
fc_w_var
=
startup2
.
global_block
().
var
(
"fc_w"
)
self
.
assertEqual
(
fc_w_var
.
shape
,
(
1000L
,
1000L
))
...
...
@@ -177,7 +186,7 @@ class TestNoSliceVar(TranspilerTest):
def
setUp
(
self
):
super
(
TestNoSliceVar
,
self
).
setUp
()
def
t
est_transpiler
(
self
):
def
t
ranspiler_test_impl
(
self
):
config
=
fluid
.
DistributeTranspilerConfig
()
config
.
slice_var_up
=
False
...
...
@@ -212,7 +221,7 @@ class TestLRDecay(TranspilerTest):
sgd_optimizer
.
minimize
(
avg_cost
)
return
def
t
est_transpiler
(
self
):
def
t
ranspiler_test_impl
(
self
):
pserver
,
startup
=
self
.
get_pserver
(
self
.
pserver1_ep
)
trainer
=
self
.
get_trainer
()
...
...
@@ -242,7 +251,7 @@ class TestLRDecayConditional(TranspilerTest):
sgd_optimizer
.
minimize
(
avg_cost
)
return
def
t
est_transpiler
(
self
):
def
t
ranspiler_test_impl
(
self
):
pserver
,
startup
=
self
.
get_pserver
(
self
.
pserver1_ep
)
trainer
=
self
.
get_trainer
()
...
...
@@ -291,7 +300,7 @@ class TestL2Decay(TranspilerTest):
sgd_optimizer
.
minimize
(
avg_cost
)
return
def
t
est_transpiler
(
self
):
def
t
ranspiler_test_impl
(
self
):
pserver
,
startup
=
self
.
get_pserver
(
self
.
pserver1_ep
)
trainer
=
self
.
get_trainer
()
...
...
@@ -326,7 +335,7 @@ class TestL2DecayWithPiecewise(TranspilerTest):
sgd_optimizer
.
minimize
(
avg_cost
)
return
def
t
est_transpiler
(
self
):
def
t
ranspiler_test_impl
(
self
):
pserver
,
startup
=
self
.
get_pserver
(
self
.
pserver1_ep
)
trainer
=
self
.
get_trainer
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录