Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
11089cac
P
Paddle
项目概览
PaddlePaddle
/
Paddle
1 年多 前同步成功
通知
2305
Star
20932
Fork
5423
代码
文件
提交
分支
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看板
未验证
提交
11089cac
编写于
10月 26, 2020
作者:
T
tianshuo78520a
提交者:
GitHub
10月 26, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix xpu notest (#28204)
* Fix xpu notest;test=kunlun * fix * test=kunlun * test=kunlun
上级
81244fbf
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
15 addition
and
9 deletion
+15
-9
paddle/scripts/paddle_build.sh
paddle/scripts/paddle_build.sh
+1
-0
python/paddle/fluid/tests/unittests/xpu/CMakeLists.txt
python/paddle/fluid/tests/unittests/xpu/CMakeLists.txt
+3
-0
python/paddle/fluid/tests/unittests/xpu/test_batch_norm_op_xpu.py
...addle/fluid/tests/unittests/xpu/test_batch_norm_op_xpu.py
+9
-7
python/paddle/fluid/tests/unittests/xpu/test_mean_op_xpu.py
python/paddle/fluid/tests/unittests/xpu/test_mean_op_xpu.py
+2
-2
未找到文件。
paddle/scripts/paddle_build.sh
浏览文件 @
11089cac
...
...
@@ -1200,6 +1200,7 @@ EOF
set
+x
ut_startTime_s
=
`
date
+%s
`
test_cases
=
$(
ctest
-N
-V
|
grep
"_xpu"
)
# cases list which would be run exclusively
get_quickly_disable_ut||disable_ut_quickly
=
''
# indicate whether the case was in quickly disable list
while
read
-r
line
;
do
if
[[
"
$line
"
==
""
]]
;
then
continue
...
...
python/paddle/fluid/tests/unittests/xpu/CMakeLists.txt
浏览文件 @
11089cac
file
(
GLOB TEST_OPS RELATIVE
"
${
CMAKE_CURRENT_SOURCE_DIR
}
"
"test_*.py"
)
string
(
REPLACE
".py"
""
TEST_OPS
"
${
TEST_OPS
}
"
)
list
(
REMOVE_ITEM TEST_OPS test_concat_op_xpu
)
list
(
REMOVE_ITEM TEST_OPS test_mean_op_xpu
)
foreach
(
TEST_OP
${
TEST_OPS
}
)
py_test_modules
(
${
TEST_OP
}
MODULES
${
TEST_OP
}
)
endforeach
(
TEST_OP
)
python/paddle/fluid/tests/unittests/xpu/test_batch_norm_op_xpu.py
浏览文件 @
11089cac
...
...
@@ -159,13 +159,15 @@ class TestXPUBatchNormOp(unittest.TestCase):
def
test_infer
(
self
):
paddle
.
enable_static
()
with
paddle
.
static
.
program_guard
(
paddle
.
static
.
Program
()):
x
=
paddle
.
data
(
'X'
,
self
.
x_np
.
shape
,
self
.
x_np
.
dtype
)
scale
=
paddle
.
data
(
'Scale'
,
self
.
scale_np
.
shape
,
self
.
scale_np
.
dtype
)
bias
=
paddle
.
data
(
'Bias'
,
self
.
bias_np
.
shape
,
self
.
bias_np
.
dtype
)
mean
=
paddle
.
data
(
'Mean'
,
self
.
mean_np
.
shape
,
self
.
mean_np
.
dtype
)
variance
=
paddle
.
data
(
'Variance'
,
self
.
variance_np
.
shape
,
self
.
variance_np
.
dtype
)
x
=
paddle
.
fluid
.
data
(
'X'
,
self
.
x_np
.
shape
,
self
.
x_np
.
dtype
)
scale
=
paddle
.
fluid
.
data
(
'Scale'
,
self
.
scale_np
.
shape
,
self
.
scale_np
.
dtype
)
bias
=
paddle
.
fluid
.
data
(
'Bias'
,
self
.
bias_np
.
shape
,
self
.
bias_np
.
dtype
)
mean
=
paddle
.
fluid
.
data
(
'Mean'
,
self
.
mean_np
.
shape
,
self
.
mean_np
.
dtype
)
variance
=
paddle
.
fluid
.
data
(
'Variance'
,
self
.
variance_np
.
shape
,
self
.
variance_np
.
dtype
)
y
=
F
.
batch_norm
(
x
,
mean
,
variance
,
scale
,
bias
,
False
,
self
.
momentum
,
self
.
epsilon
,
self
.
data_layout
)
exe
=
paddle
.
static
.
Executor
(
self
.
place
)
...
...
python/paddle/fluid/tests/unittests/xpu/test_mean_op_xpu.py
浏览文件 @
11089cac
...
...
@@ -88,7 +88,7 @@ class TestMeanAPI(unittest.TestCase):
def
test_api_static
(
self
):
paddle
.
enable_static
()
with
paddle
.
static
.
program_guard
(
paddle
.
static
.
Program
()):
x
=
paddle
.
data
(
'X'
,
self
.
x_shape
)
x
=
paddle
.
fluid
.
data
(
'X'
,
self
.
x_shape
)
out1
=
paddle
.
mean
(
x
)
out2
=
paddle
.
tensor
.
mean
(
x
)
out3
=
paddle
.
tensor
.
stat
.
mean
(
x
)
...
...
@@ -136,7 +136,7 @@ class TestMeanAPI(unittest.TestCase):
self
.
assertRaises
(
Exception
,
paddle
.
mean
,
x
,
2
)
paddle
.
enable_static
()
with
paddle
.
static
.
program_guard
(
paddle
.
static
.
Program
()):
x
=
paddle
.
data
(
'X'
,
[
10
,
12
],
'int32'
)
x
=
paddle
.
fluid
.
data
(
'X'
,
[
10
,
12
],
'int32'
)
self
.
assertRaises
(
TypeError
,
paddle
.
mean
,
x
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录