Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleDetection
提交
e025fc97
P
PaddleDetection
项目概览
PaddlePaddle
/
PaddleDetection
大约 1 年 前同步成功
通知
695
Star
11112
Fork
2696
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
184
列表
看板
标记
里程碑
合并请求
40
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleDetection
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
184
Issue
184
列表
看板
标记
里程碑
合并请求
40
合并请求
40
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
e025fc97
编写于
10月 28, 2018
作者:
S
seiriosPlus
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix unit test in cpu 1.1
上级
641369f9
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
23 addition
and
27 deletion
+23
-27
python/paddle/fluid/op.py
python/paddle/fluid/op.py
+2
-0
python/paddle/fluid/tests/unittests/test_dist_transpiler.py
python/paddle/fluid/tests/unittests/test_dist_transpiler.py
+21
-27
未找到文件。
python/paddle/fluid/op.py
浏览文件 @
e025fc97
...
@@ -120,6 +120,8 @@ class OpDescCreationMethod(object):
...
@@ -120,6 +120,8 @@ class OpDescCreationMethod(object):
new_attr
.
strings
.
extend
(
user_defined_attr
)
new_attr
.
strings
.
extend
(
user_defined_attr
)
elif
attr
.
type
==
framework_pb2
.
BOOLEANS
:
elif
attr
.
type
==
framework_pb2
.
BOOLEANS
:
new_attr
.
bools
.
extend
(
user_defined_attr
)
new_attr
.
bools
.
extend
(
user_defined_attr
)
elif
attr
.
type
==
framework_pb2
.
LONGS
:
new_attr
.
longs
.
extend
(
user_defined_attr
)
elif
attr
.
type
==
framework_pb2
.
INT_PAIRS
:
elif
attr
.
type
==
framework_pb2
.
INT_PAIRS
:
for
p
in
user_defined_attr
:
for
p
in
user_defined_attr
:
pair
=
new_attr
.
int_pairs
.
add
()
pair
=
new_attr
.
int_pairs
.
add
()
...
...
python/paddle/fluid/tests/unittests/test_dist_transpiler.py
浏览文件 @
e025fc97
...
@@ -480,7 +480,7 @@ class TestDistLookupTable(TestDistLookupTableBase):
...
@@ -480,7 +480,7 @@ class TestDistLookupTable(TestDistLookupTableBase):
def
transpiler_test_impl
(
self
):
def
transpiler_test_impl
(
self
):
pserver1
,
startup1
=
self
.
get_pserver
(
self
.
pserver1_ep
)
pserver1
,
startup1
=
self
.
get_pserver
(
self
.
pserver1_ep
)
self
.
assertEqual
(
len
(
pserver1
.
blocks
),
6
)
self
.
assertEqual
(
len
(
pserver1
.
blocks
),
5
)
# 0 listen_and_serv
# 0 listen_and_serv
# 1 optimize for fc_w or fc_b adam
# 1 optimize for fc_w or fc_b adam
self
.
assertEqual
([
op
.
type
for
op
in
pserver1
.
blocks
[
1
].
ops
],
self
.
assertEqual
([
op
.
type
for
op
in
pserver1
.
blocks
[
1
].
ops
],
...
@@ -491,23 +491,19 @@ class TestDistLookupTable(TestDistLookupTableBase):
...
@@ -491,23 +491,19 @@ class TestDistLookupTable(TestDistLookupTableBase):
# 3 prefetch -> lookup_sparse_table for data0
# 3 prefetch -> lookup_sparse_table for data0
self
.
assertEqual
([
op
.
type
for
op
in
pserver1
.
blocks
[
3
].
ops
],
self
.
assertEqual
([
op
.
type
for
op
in
pserver1
.
blocks
[
3
].
ops
],
[
"lookup_sparse_table"
])
[
"lookup_sparse_table"
])
# 4 prefetch -> lookup_sparse_table for data1
# 4 save table
self
.
assertEqual
([
op
.
type
for
op
in
pserver1
.
blocks
[
4
].
ops
],
self
.
assertEqual
([
op
.
type
for
op
in
pserver1
.
blocks
[
4
].
ops
],
[
"save"
])
[
"lookup_sparse_table"
])
# 5 save table
self
.
assertEqual
([
op
.
type
for
op
in
pserver1
.
blocks
[
5
].
ops
],
[
"save"
])
trainer
,
trainer_startup
=
self
.
get_trainer
()
trainer
,
trainer_startup
=
self
.
get_trainer
()
self
.
assertEqual
(
len
(
trainer
.
blocks
),
1
)
self
.
assertEqual
(
len
(
trainer
.
blocks
),
1
)
ops
=
[
ops
=
[
'split_ids'
,
'prefetch'
,
'merge_ids'
,
'sequence_pool'
,
'split_ids'
,
'split_ids'
,
'prefetch'
,
'merge_ids'
,
'sequence_pool'
,
'prefetch'
,
'merge_ids'
,
'sequence_pool'
,
'concat'
,
'mul'
,
'sequence_pool'
,
'concat'
,
'mul'
,
'elementwise_add'
,
'elementwise_add'
,
'cross_entropy'
,
'mean'
,
'fill_constant'
,
'cross_entropy'
,
'mean'
,
'fill_constant'
,
'mean_grad'
,
'mean_grad'
,
'cross_entropy_grad'
,
'elementwise_add_grad'
,
'send'
,
'cross_entropy_grad'
,
'elementwise_add_grad'
,
'send'
,
'mul_grad'
,
'mul_grad'
,
'send'
,
'concat_grad'
,
'sequence_pool_grad'
,
'send'
,
'concat_grad'
,
'sequence_pool_grad'
,
'lookup_table_grad'
,
'lookup_table_grad'
,
'sequence_pool_grad'
,
'lookup_table_grad'
,
'sequence_pool_grad'
,
'lookup_table_grad'
,
'sum'
,
'split_ids'
,
'sum'
,
'split_ids'
,
'send'
,
'send_barrier'
,
'recv'
,
'recv'
,
'send'
,
'send_barrier'
,
'recv'
,
'recv'
,
'fetch_barrier'
'fetch_barrier'
]
]
self
.
assertEqual
([
op
.
type
for
op
in
trainer
.
blocks
[
0
].
ops
],
ops
)
self
.
assertEqual
([
op
.
type
for
op
in
trainer
.
blocks
[
0
].
ops
],
ops
)
...
@@ -563,7 +559,7 @@ class TestAsyncDistLookupTable(TestDistLookupTableBase):
...
@@ -563,7 +559,7 @@ class TestAsyncDistLookupTable(TestDistLookupTableBase):
pserver1
,
startup1
=
self
.
get_pserver
(
self
.
pserver1_ep
,
config
,
False
)
pserver1
,
startup1
=
self
.
get_pserver
(
self
.
pserver1_ep
,
config
,
False
)
self
.
assertEqual
(
len
(
pserver1
.
blocks
),
6
)
self
.
assertEqual
(
len
(
pserver1
.
blocks
),
5
)
# 0 listen_and_serv
# 0 listen_and_serv
# 1 optimize for fc_w or fc_b adam
# 1 optimize for fc_w or fc_b adam
self
.
assertEqual
([
op
.
type
for
op
in
pserver1
.
blocks
[
1
].
ops
],
self
.
assertEqual
([
op
.
type
for
op
in
pserver1
.
blocks
[
1
].
ops
],
...
@@ -573,23 +569,21 @@ class TestAsyncDistLookupTable(TestDistLookupTableBase):
...
@@ -573,23 +569,21 @@ class TestAsyncDistLookupTable(TestDistLookupTableBase):
# 3 prefetch -> lookup_sparse_table for data0
# 3 prefetch -> lookup_sparse_table for data0
self
.
assertEqual
([
op
.
type
for
op
in
pserver1
.
blocks
[
3
].
ops
],
self
.
assertEqual
([
op
.
type
for
op
in
pserver1
.
blocks
[
3
].
ops
],
[
"lookup_sparse_table"
])
[
"lookup_sparse_table"
])
# 4 prefetch -> lookup_sparse_table for data1
# 4 save table
self
.
assertEqual
([
op
.
type
for
op
in
pserver1
.
blocks
[
4
].
ops
],
self
.
assertEqual
([
op
.
type
for
op
in
pserver1
.
blocks
[
4
].
ops
],
[
"save"
])
[
"lookup_sparse_table"
])
# 5 save table
self
.
assertEqual
([
op
.
type
for
op
in
pserver1
.
blocks
[
5
].
ops
],
[
"save"
])
trainer
,
_
=
self
.
get_trainer
(
config
)
trainer
,
_
=
self
.
get_trainer
(
config
)
self
.
assertEqual
(
len
(
trainer
.
blocks
),
1
)
self
.
assertEqual
(
len
(
trainer
.
blocks
),
1
)
ops
=
[
ops
=
[
'split_ids'
,
'prefetch'
,
'merge_ids'
,
'sequence_pool'
,
'split_ids'
,
'split_ids'
,
'prefetch'
,
'merge_ids'
,
'sequence_pool'
,
'
prefetch'
,
'merge_ids'
,
'sequence_pool'
,
'concat'
,
'mul
'
,
'
sequence_pool'
,
'concat'
,
'mul'
,
'elementwise_add
'
,
'
elementwise_add'
,
'cross_entropy'
,
'mean'
,
'fill_constant
'
,
'
cross_entropy'
,
'mean'
,
'fill_constant'
,
'mean_grad
'
,
'
mean_grad'
,
'cross_entropy_grad'
,
'elementwise_add_grad'
,
'sen
d'
,
'
cross_entropy_grad'
,
'elementwise_add_grad'
,
'send'
,
'mul_gra
d'
,
'
mul_grad'
,
'send'
,
'concat_grad'
,
'sequence_pool
_grad'
,
'
send'
,
'concat_grad'
,
'sequence_pool_grad'
,
'lookup_table
_grad'
,
'
lookup_table_grad'
,
'sequence_pool_grad'
,
'lookup_table_grad
'
,
'
sequence_pool_grad'
,
'lookup_table_grad'
,
'sum'
,
'split_ids
'
,
's
um'
,
'split_ids'
,
's
end'
,
'recv'
,
'recv'
'send'
,
'recv'
,
'recv'
]
]
self
.
assertEqual
([
op
.
type
for
op
in
trainer
.
blocks
[
0
].
ops
],
ops
)
self
.
assertEqual
([
op
.
type
for
op
in
trainer
.
blocks
[
0
].
ops
],
ops
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录