Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleDetection
提交
72965226
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看板
未验证
提交
72965226
编写于
8月 21, 2018
作者:
Q
Qiyang Min
提交者:
GitHub
8月 21, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #12818 from velconia/fix_python3_CI_job
Fix python3 CI job
上级
f63368db
656c77e7
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
15 addition
and
11 deletion
+15
-11
paddle/fluid/framework/ir/graph_test.cc
paddle/fluid/framework/ir/graph_test.cc
+3
-1
python/paddle/fluid/tests/unittests/test_desc_clone.py
python/paddle/fluid/tests/unittests/test_desc_clone.py
+10
-8
python/paddle/fluid/transpiler/distribute_transpiler.py
python/paddle/fluid/transpiler/distribute_transpiler.py
+2
-2
未找到文件。
paddle/fluid/framework/ir/graph_test.cc
浏览文件 @
72965226
...
...
@@ -200,9 +200,11 @@ TEST(GraphTest, WriteAfterWrite) {
ASSERT_TRUE
(
ir
::
IsControlDepVar
(
*
n
->
inputs
[
1
]));
control_dep2
=
n
->
inputs
[
1
];
ASSERT_EQ
(
n
->
inputs
.
size
(),
2
);
ASSERT_EQ
(
control_dep1
,
control_dep2
);
}
}
ASSERT_NE
(
control_dep1
,
nullptr
);
ASSERT_NE
(
control_dep2
,
nullptr
);
ASSERT_EQ
(
control_dep1
,
control_dep2
);
}
}
// namespace framework
}
// namespace paddle
python/paddle/fluid/tests/unittests/test_desc_clone.py
浏览文件 @
72965226
...
...
@@ -27,6 +27,7 @@ import unittest
from
multiprocessing
import
Process
import
os
import
signal
import
six
import
collections
SEED
=
1
...
...
@@ -55,7 +56,8 @@ def cnn_model(data):
# TODO(dzhwinter) : refine the initializer and random seed settting
SIZE
=
10
input_shape
=
conv_pool_2
.
shape
param_shape
=
[
reduce
(
lambda
a
,
b
:
a
*
b
,
input_shape
[
1
:],
1
)]
+
[
SIZE
]
param_shape
=
[
six
.
moves
.
reduce
(
lambda
a
,
b
:
a
*
b
,
input_shape
[
1
:],
1
)
]
+
[
SIZE
]
scale
=
(
2.0
/
(
param_shape
[
0
]
**
2
*
SIZE
))
**
0.5
predict
=
fluid
.
layers
.
fc
(
...
...
@@ -108,7 +110,7 @@ def get_transpiler(trainer_id, main_program, pserver_endpoints, trainers):
def
operator_equal
(
a
,
b
):
for
k
,
v
in
a
.
__dict__
.
iteritems
(
):
for
k
,
v
in
six
.
iteritems
(
a
.
__dict__
):
if
isinstance
(
v
,
fluid
.
framework
.
Program
)
or
\
isinstance
(
v
,
fluid
.
framework
.
Block
):
continue
...
...
@@ -118,8 +120,8 @@ def operator_equal(a, b):
raise
ValueError
(
"In operator_equal not equal:{0}
\n
"
.
format
(
k
))
elif
isinstance
(
v
,
collections
.
OrderedDict
):
v0
=
sorted
(
v
.
iteritems
(
),
key
=
lambda
x
:
x
[
0
])
v1
=
sorted
(
b
.
__dict__
[
k
].
iteritems
(
),
key
=
lambda
x
:
x
[
0
])
v0
=
sorted
(
six
.
iteritems
(
v
),
key
=
lambda
x
:
x
[
0
])
v1
=
sorted
(
six
.
iteritems
(
b
.
__dict__
[
k
]
),
key
=
lambda
x
:
x
[
0
])
if
v0
!=
v1
:
raise
ValueError
(
"In operator_equal not equal:{0}
\n
"
.
format
(
k
))
...
...
@@ -131,7 +133,7 @@ def operator_equal(a, b):
def
block_equal
(
a
,
b
):
for
k
,
v
in
a
.
__dict__
.
iteritems
(
):
for
k
,
v
in
six
.
iteritems
(
a
.
__dict__
):
if
isinstance
(
v
,
core
.
ProgramDesc
)
or
isinstance
(
v
,
fluid
.
framework
.
Program
)
or
isinstance
(
v
,
core
.
BlockDesc
):
continue
...
...
@@ -143,8 +145,8 @@ def block_equal(a, b):
assert
(
len
(
a
.
ops
)
==
len
(
b
.
ops
))
elif
isinstance
(
v
,
collections
.
OrderedDict
):
v0
=
sorted
(
v
.
iteritems
(
),
key
=
lambda
x
:
x
[
0
])
v1
=
sorted
(
b
.
__dict__
[
k
].
iteritems
(
),
key
=
lambda
x
:
x
[
0
])
v0
=
sorted
(
six
.
iteritems
(
v
),
key
=
lambda
x
:
x
[
0
])
v1
=
sorted
(
six
.
iteritems
(
b
.
__dict__
[
k
]
),
key
=
lambda
x
:
x
[
0
])
if
v0
!=
v1
:
raise
ValueError
(
"In block_equal not equal:{0}
\n
"
.
format
(
k
))
...
...
@@ -156,7 +158,7 @@ def block_equal(a, b):
def
program_equal
(
a
,
b
):
for
k
,
v
in
a
.
__dict__
.
iteritems
(
):
for
k
,
v
in
six
.
iteritems
(
a
.
__dict__
):
if
isinstance
(
v
,
core
.
ProgramDesc
):
continue
...
...
python/paddle/fluid/transpiler/distribute_transpiler.py
浏览文件 @
72965226
...
...
@@ -369,7 +369,7 @@ class DistributeTranspiler(object):
# FIXME(gongwb): delete not need ops.
# note that: some parameter is not trainable and those ops can't be deleted.
for
varname
,
splited_var
in
s
elf
.
param_var_mapping
.
iteritems
(
):
for
varname
,
splited_var
in
s
ix
.
iteritems
(
self
.
param_var_mapping
):
# Get the eplist of recv vars
eps
=
[]
for
var
in
splited_var
:
...
...
@@ -406,7 +406,7 @@ class DistributeTranspiler(object):
RPC_OP_ROLE_ATTR_NAME
:
RPC_OP_ROLE_ATTR_VALUE
})
for
varname
,
splited_var
in
s
elf
.
param_var_mapping
.
iteritems
(
):
for
varname
,
splited_var
in
s
ix
.
iteritems
(
self
.
param_var_mapping
):
#add concat ops to merge splited parameters received from parameter servers.
if
len
(
splited_var
)
<=
1
:
continue
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录