Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
b8352611
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看板
未验证
提交
b8352611
编写于
6月 05, 2023
作者:
Z
zzk0
提交者:
GitHub
6月 05, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[CINN] Enable check_cinn on some tests (#54261)
* [CINN] Enable check_cinn * add CMakeLists.txt
上级
0a0fbb1a
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
24 addition
and
18 deletion
+24
-18
test/legacy_test/CMakeLists.txt
test/legacy_test/CMakeLists.txt
+7
-1
test/legacy_test/test_arg_min_max_op.py
test/legacy_test/test_arg_min_max_op.py
+1
-1
test/legacy_test/test_flip.py
test/legacy_test/test_flip.py
+4
-4
test/legacy_test/test_reverse_op.py
test/legacy_test/test_reverse_op.py
+2
-2
test/legacy_test/test_scatter_nd_op.py
test/legacy_test/test_scatter_nd_op.py
+4
-4
test/legacy_test/test_strided_slice_op.py
test/legacy_test/test_strided_slice_op.py
+4
-4
test/legacy_test/test_triangular_solve_op.py
test/legacy_test/test_triangular_solve_op.py
+2
-2
未找到文件。
test/legacy_test/CMakeLists.txt
浏览文件 @
b8352611
...
...
@@ -1189,7 +1189,13 @@ set(TEST_CINN_OPS
test_tile_op
test_roll_op
test_sum_op
test_elementwise_min_op
)
test_elementwise_min_op
test_arg_min_max_op
test_reverse_op
test_flip
test_triangular_solve_op
test_scatter_nd_op
test_strided_slice_op
)
foreach
(
TEST_CINN_OPS
${
TEST_CINN_OPS
}
)
if
(
WITH_CINN
)
...
...
test/legacy_test/test_arg_min_max_op.py
浏览文件 @
b8352611
...
...
@@ -42,7 +42,7 @@ class BaseTestCase(OpTest):
self
.
outputs
=
{
'Out'
:
np
.
argmax
(
self
.
x
,
axis
=
self
.
axis
)}
def
test_check_output
(
self
):
self
.
check_output
()
self
.
check_output
(
check_cinn
=
True
)
class
TestCase0
(
BaseTestCase
):
...
...
test/legacy_test/test_flip.py
浏览文件 @
b8352611
...
...
@@ -100,10 +100,10 @@ class TestFlipOp(OpTest):
self
.
attrs
=
{
"axis"
:
self
.
axis
}
def
test_check_output
(
self
):
self
.
check_output
()
self
.
check_output
(
check_cinn
=
True
)
def
test_check_grad
(
self
):
self
.
check_grad
([
"X"
],
"Out"
)
self
.
check_grad
([
"X"
],
"Out"
,
check_cinn
=
True
)
def
init_test_case
(
self
):
self
.
in_shape
=
(
6
,
4
,
2
,
3
)
...
...
@@ -167,12 +167,12 @@ def create_test_fp16_class(parent):
if
core
.
is_compiled_with_cuda
():
place
=
core
.
CUDAPlace
(
0
)
if
core
.
is_float16_supported
(
place
):
self
.
check_output_with_place
(
place
)
self
.
check_output_with_place
(
place
,
check_cinn
=
True
)
def
test_check_grad
(
self
):
place
=
core
.
CUDAPlace
(
0
)
if
core
.
is_float16_supported
(
place
):
self
.
check_grad_with_place
(
place
,
[
"X"
],
"Out"
)
self
.
check_grad_with_place
(
place
,
[
"X"
],
"Out"
,
check_cinn
=
True
)
cls_name
=
"{}_{}"
.
format
(
parent
.
__name__
,
"FP16OP"
)
TestFlipFP16
.
__name__
=
cls_name
...
...
test/legacy_test/test_reverse_op.py
浏览文件 @
b8352611
...
...
@@ -37,10 +37,10 @@ class TestReverseOp(OpTest):
self
.
outputs
=
{
'Out'
:
out
}
def
test_check_output
(
self
):
self
.
check_output
()
self
.
check_output
(
check_cinn
=
True
)
def
test_check_grad
(
self
):
self
.
check_grad
([
'X'
],
'Out'
)
self
.
check_grad
([
'X'
],
'Out'
,
check_cinn
=
True
)
class
TestCase0
(
TestReverseOp
):
...
...
test/legacy_test/test_scatter_nd_op.py
浏览文件 @
b8352611
...
...
@@ -93,7 +93,7 @@ class TestScatterNdAddSimpleOp(OpTest):
self
.
dtype
=
np
.
float64
def
test_check_output
(
self
):
self
.
check_output
()
self
.
check_output
(
check_cinn
=
True
)
def
test_check_grad
(
self
):
self
.
check_grad
([
'X'
,
'Updates'
],
'Out'
,
check_prim
=
True
)
...
...
@@ -169,7 +169,7 @@ class TestScatterNdAddWithEmptyIndex(OpTest):
self
.
dtype
=
np
.
float64
def
test_check_output
(
self
):
self
.
check_output
()
self
.
check_output
(
check_cinn
=
True
)
def
test_check_grad
(
self
):
self
.
check_grad
([
'X'
,
'Updates'
],
'Out'
,
check_prim
=
True
)
...
...
@@ -248,7 +248,7 @@ class TestScatterNdAddWithHighRankSame(OpTest):
self
.
dtype
=
np
.
float64
def
test_check_output
(
self
):
self
.
check_output
()
self
.
check_output
(
check_cinn
=
True
)
def
test_check_grad
(
self
):
self
.
check_grad
([
'X'
,
'Updates'
],
'Out'
,
check_prim
=
True
)
...
...
@@ -311,7 +311,7 @@ class TestScatterNdAddWithHighRankDiff(OpTest):
self
.
outputs
=
{
'Out'
:
expect_np
}
def
test_check_output
(
self
):
self
.
check_output
()
self
.
check_output
(
check_cinn
=
True
)
def
test_check_grad
(
self
):
self
.
check_grad
([
'X'
,
'Updates'
],
'Out'
,
check_prim
=
True
)
...
...
test/legacy_test/test_strided_slice_op.py
浏览文件 @
b8352611
...
...
@@ -96,10 +96,10 @@ class TestStrideSliceOp(OpTest):
}
def
test_check_output
(
self
):
self
.
check_output
()
self
.
check_output
(
check_cinn
=
True
)
def
test_check_grad
(
self
):
self
.
check_grad
({
'Input'
},
'Out'
)
self
.
check_grad
({
'Input'
},
'Out'
,
check_cinn
=
True
)
def
initTestCase
(
self
):
self
.
input
=
np
.
random
.
rand
(
100
)
...
...
@@ -1032,10 +1032,10 @@ class TestStrideSliceFP16Op(OpTest):
}
def
test_check_output
(
self
):
self
.
check_output
()
self
.
check_output
(
check_cinn
=
True
)
def
test_check_grad
(
self
):
self
.
check_grad
({
'Input'
},
'Out'
)
self
.
check_grad
({
'Input'
},
'Out'
,
check_cinn
=
True
)
def
initTestCase
(
self
):
self
.
input
=
np
.
random
.
rand
(
100
)
...
...
test/legacy_test/test_triangular_solve_op.py
浏览文件 @
b8352611
...
...
@@ -64,10 +64,10 @@ class TestTriangularSolveOp(OpTest):
self
.
outputs
=
{
'Out'
:
self
.
output
}
def
test_check_output
(
self
):
self
.
check_output
()
self
.
check_output
(
check_cinn
=
True
)
def
test_check_grad_normal
(
self
):
self
.
check_grad
([
'X'
,
'Y'
],
'Out'
)
self
.
check_grad
([
'X'
,
'Y'
],
'Out'
,
check_cinn
=
True
)
# 2D(broadcast) + 3D, test 'transpose'
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录