Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
Paddle
提交
beb93bb9
P
Paddle
项目概览
BaiXuePrincess
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
beb93bb9
编写于
8月 20, 2018
作者:
M
minqiyang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix ut bug for graph_test
Port dist_transpiler new added codes Port ut for clone desc
上级
2906d839
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
28 addition
and
6 deletion
+28
-6
paddle/fluid/framework/ir/graph_test.cc
paddle/fluid/framework/ir/graph_test.cc
+3
-1
paddle/scripts/paddle_build.sh
paddle/scripts/paddle_build.sh
+12
-1
python/paddle/fluid/tests/unittests/op_test.py
python/paddle/fluid/tests/unittests/op_test.py
+1
-1
python/paddle/fluid/tests/unittests/test_desc_clone.py
python/paddle/fluid/tests/unittests/test_desc_clone.py
+3
-1
python/paddle/fluid/tests/unittests/test_prelu_op.py
python/paddle/fluid/tests/unittests/test_prelu_op.py
+7
-0
python/paddle/fluid/transpiler/distribute_transpiler.py
python/paddle/fluid/transpiler/distribute_transpiler.py
+2
-2
未找到文件。
paddle/fluid/framework/ir/graph_test.cc
浏览文件 @
beb93bb9
...
...
@@ -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
paddle/scripts/paddle_build.sh
浏览文件 @
beb93bb9
...
...
@@ -313,7 +313,18 @@ function run_test() {
Running unit tests ...
========================================
EOF
ctest
--output-on-failure
ctest
--output-on-failure
-R
graph_test
-V
ctest
--output-on-failure
-R
test_prelu_op
-V
ctest
--output-on-failure
-R
test_prelu_op
-V
ctest
--output-on-failure
-R
test_dist_transpiler
-V
ctest
--output-on-failure
-R
test_dist_word2vec
-V
ctest
--output-on-failure
-R
test_desc_clone
-V
ctest
--output-on-failure
-R
test_dist_mnist
-V
ctest
--output-on-failure
-R
test_listen_and_serv_op
-V
ctest
--output-on-failure
-R
test_debugger
-V
ctest
--output-on-failure
-R
test_dist_transformer
-V
ctest
--output-on-failure
-R
test_dist_se_resnext
-V
# make install should also be test when unittest
make
install
-j
`
nproc
`
pip
install
/usr/local/opt/paddle/share/wheels/
*
.whl
...
...
python/paddle/fluid/tests/unittests/op_test.py
浏览文件 @
beb93bb9
...
...
@@ -123,7 +123,7 @@ def get_numeric_gradient(place,
y_neg
=
get_output
()
__set_elem__
(
tensor_to_check
,
i
,
origin
)
gradient_flat
[
i
]
=
(
y_pos
-
y_neg
)
/
delta
/
2
gradient_flat
[
i
]
=
(
y_pos
-
y_neg
)
/
delta
/
/
2
return
gradient_flat
.
reshape
(
tensor_to_check
.
shape
())
...
...
python/paddle/fluid/tests/unittests/test_desc_clone.py
浏览文件 @
beb93bb9
...
...
@@ -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
(
...
...
python/paddle/fluid/tests/unittests/test_prelu_op.py
浏览文件 @
beb93bb9
...
...
@@ -39,10 +39,17 @@ class PReluTest(OpTest):
alpha_np
=
np
.
random
.
rand
(
*
x_np
.
shape
).
astype
(
"float32"
)
self
.
inputs
=
{
'X'
:
x_np
,
'Alpha'
:
alpha_np
}
import
sys
print
(
'self.inputs'
,
self
.
inputs
)
sys
.
stdout
.
flush
()
out_np
=
np
.
maximum
(
self
.
inputs
[
'X'
],
0.
)
out_np
=
out_np
+
np
.
minimum
(
self
.
inputs
[
'X'
],
0.
)
*
self
.
inputs
[
'Alpha'
]
assert
out_np
is
not
self
.
inputs
[
'X'
]
import
sys
print
(
'self.outputs'
,
self
.
outputs
)
sys
.
stdout
.
flush
()
self
.
outputs
=
{
'Out'
:
out_np
}
def
initTestCase
(
self
):
...
...
python/paddle/fluid/transpiler/distribute_transpiler.py
浏览文件 @
beb93bb9
...
...
@@ -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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录