Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
fa2f67a5
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看板
未验证
提交
fa2f67a5
编写于
10月 13, 2022
作者:
P
Paulina Gacek
提交者:
GitHub
10月 13, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Tests for other dtypes corrected (#46836)
上级
78add057
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
12 addition
and
23 deletion
+12
-23
python/paddle/fluid/tests/unittests/mkldnn/test_nearest_interp_mkldnn_op.py
...d/tests/unittests/mkldnn/test_nearest_interp_mkldnn_op.py
+8
-14
python/paddle/fluid/tests/unittests/mkldnn/test_nearest_interp_v2_mkldnn_op.py
...ests/unittests/mkldnn/test_nearest_interp_v2_mkldnn_op.py
+4
-9
未找到文件。
python/paddle/fluid/tests/unittests/mkldnn/test_nearest_interp_mkldnn_op.py
浏览文件 @
fa2f67a5
...
...
@@ -63,7 +63,7 @@ class TestNearestInterpMKLDNNOp(OpTest):
pass
def
init_data_type
(
self
):
pass
self
.
dtype
=
np
.
float32
def
setUp
(
self
):
self
.
op_type
=
"nearest_interp"
...
...
@@ -72,7 +72,6 @@ class TestNearestInterpMKLDNNOp(OpTest):
self
.
use_mkldnn
=
True
self
.
input_shape
=
[
1
,
1
,
2
,
2
]
self
.
data_layout
=
'NCHW'
self
.
dtype
=
np
.
float32
# priority: actual_shape > out_size > scale > out_h & out_w
self
.
out_h
=
1
self
.
out_w
=
1
...
...
@@ -176,11 +175,9 @@ class TestNearestNeighborInterpSame(TestNearestInterpMKLDNNOp):
def
create_test_class
(
parent
):
class
TestFp32Case
(
parent
):
def
init_data_type
(
self
):
self
.
dtype
=
np
.
float32
'''
Create tests for int, uint8. By default parent class works on fp32.
'''
class
TestInt8Case
(
parent
):
...
...
@@ -192,12 +189,10 @@ def create_test_class(parent):
def
init_data_type
(
self
):
self
.
dtype
=
np
.
uint8
TestFp32Case
.
__name__
=
parent
.
__name__
TestInt8Case
.
__name__
=
parent
.
__name__
TestUint8Case
.
__name__
=
parent
.
__name__
globals
()[
parent
.
__name__
]
=
TestFp32Case
globals
()[
parent
.
__name__
]
=
TestInt8Case
globals
()[
parent
.
__name__
]
=
TestUint8Case
TestInt8Case
.
__name__
=
"{0}_{1}"
.
format
(
parent
.
__name__
,
"INT8"
)
TestUint8Case
.
__name__
=
"{0}_{1}"
.
format
(
parent
.
__name__
,
"UINT8"
)
globals
()[
TestInt8Case
.
__name__
]
=
TestInt8Case
globals
()[
TestUint8Case
.
__name__
]
=
TestUint8Case
create_test_class
(
TestNearestInterpMKLDNNOp
)
...
...
@@ -205,7 +200,6 @@ create_test_class(TestNearestInterpOpMKLDNNNHWC)
create_test_class
(
TestNearestNeighborInterpMKLDNNCase2
)
create_test_class
(
TestNearestNeighborInterpCase3
)
create_test_class
(
TestNearestNeighborInterpCase4
)
create_test_class
(
TestNearestInterpOpMKLDNNNHWC
)
create_test_class
(
TestNearestNeighborInterpSame
)
if
__name__
==
"__main__"
:
...
...
python/paddle/fluid/tests/unittests/mkldnn/test_nearest_interp_v2_mkldnn_op.py
浏览文件 @
fa2f67a5
...
...
@@ -64,7 +64,7 @@ class TestNearestInterpV2MKLDNNOp(OpTest):
pass
def
init_data_type
(
self
):
pass
self
.
dtype
=
np
.
float32
def
setUp
(
self
):
self
.
op_type
=
"nearest_interp_v2"
...
...
@@ -73,7 +73,6 @@ class TestNearestInterpV2MKLDNNOp(OpTest):
self
.
use_mkldnn
=
True
self
.
input_shape
=
[
1
,
1
,
2
,
2
]
self
.
data_layout
=
'NCHW'
self
.
dtype
=
np
.
float32
# priority: actual_shape > out_size > scale > out_h & out_w
self
.
out_h
=
1
self
.
out_w
=
1
...
...
@@ -196,11 +195,9 @@ class TestNearestNeighborInterpV2MKLDNNSame(TestNearestInterpV2MKLDNNOp):
def
create_test_class
(
parent
):
class
TestFp32Case
(
parent
):
def
init_data_type
(
self
):
self
.
dtype
=
np
.
float32
'''
Create tests for bf16, int, uint8. By default parent class works on fp32.
'''
class
TestBf16Case
(
parent
):
...
...
@@ -217,11 +214,9 @@ def create_test_class(parent):
def
init_data_type
(
self
):
self
.
dtype
=
np
.
uint8
TestFp32Case
.
__name__
=
"{0}_{1}"
.
format
(
parent
.
__name__
,
"FP32"
)
TestBf16Case
.
__name__
=
"{0}_{1}"
.
format
(
parent
.
__name__
,
"BF16"
)
TestInt8Case
.
__name__
=
"{0}_{1}"
.
format
(
parent
.
__name__
,
"INT8"
)
TestUint8Case
.
__name__
=
"{0}_{1}"
.
format
(
parent
.
__name__
,
"UINT8"
)
globals
()[
TestFp32Case
.
__name__
]
=
TestFp32Case
globals
()[
TestBf16Case
.
__name__
]
=
TestBf16Case
globals
()[
TestInt8Case
.
__name__
]
=
TestInt8Case
globals
()[
TestUint8Case
.
__name__
]
=
TestUint8Case
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录