Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
087c3abe
P
Paddle
项目概览
机器未来
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
087c3abe
编写于
10月 24, 2021
作者:
J
JingZhuangzhuang
提交者:
GitHub
10月 25, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix pool2d convert case (#36667)
上级
e2173b68
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
27 addition
and
3 deletion
+27
-3
python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_pool2d.py
...d/tests/unittests/ir/inference/test_trt_convert_pool2d.py
+27
-3
未找到文件。
python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_pool2d.py
浏览文件 @
087c3abe
...
...
@@ -18,6 +18,7 @@ import numpy as np
import
paddle.inference
as
paddle_infer
from
functools
import
partial
from
typing
import
Optional
,
List
,
Callable
,
Dict
,
Any
,
Set
import
unittest
class
TrtConvertPool2dTest
(
TrtLayerAutoScanTest
):
...
...
@@ -46,16 +47,16 @@ class TrtConvertPool2dTest(TrtLayerAutoScanTest):
def
generate_weight1
(
attrs
:
List
[
Dict
[
str
,
Any
]]):
return
np
.
random
.
random
([
24
,
3
,
3
,
3
]).
astype
(
np
.
float32
)
for
strides
in
[[
1
,
1
],
[
2
,
2
],
[
1
,
2
]]:
for
strides
in
[[
1
,
1
],
[
1
,
2
],
[
2
,
2
]]:
for
paddings
in
[[
0
,
2
],
[
0
,
3
],
[
0
,
1
,
2
,
3
]]:
for
pooling_type
in
[
'max'
,
'avg'
]:
for
padding_algotithm
in
[
'EXPLICIT'
,
'SAME'
,
'VAILD'
]:
for
ksize
in
[[
2
,
3
],
[
3
,
3
]]:
for
data_format
in
[
'NCHW'
]:
for
global_pooling
in
[
True
,
False
]:
for
exclusive
in
[
True
,
Fals
e
]:
for
exclusive
in
[
False
,
Tru
e
]:
for
adaptive
in
[
True
,
False
]:
for
ceil_mode
in
[
True
,
Fals
e
]:
for
ceil_mode
in
[
False
,
Tru
e
]:
dics
=
[{
"pooling_type"
:
...
...
@@ -157,6 +158,29 @@ class TrtConvertPool2dTest(TrtLayerAutoScanTest):
teller2
,
SkipReasons
.
TRT_NOT_IMPLEMENTED
,
"It is not support that global_pooling is true for trt now."
)
def
teller3
(
program_config
,
predictor_config
):
if
self
.
dynamic_shape
.
min_input_shape
==
{}
and
program_config
.
ops
[
0
].
attrs
[
'ceil_mode'
]
==
True
:
return
True
return
False
self
.
add_skip_case
(
teller3
,
SkipReasons
.
TRT_NOT_IMPLEMENTED
,
"It is not support that ceil_mode is true in static mode for trt now."
)
def
teller4
(
program_config
,
predictor_config
):
if
self
.
dynamic_shape
.
min_input_shape
!=
{}
and
(
program_config
.
ops
[
0
].
attrs
[
'strides'
]
==
[
1
,
2
]
or
program_config
.
ops
[
0
].
attrs
[
'strides'
]
==
[
2
,
2
]):
return
True
return
False
self
.
add_skip_case
(
teller4
,
SkipReasons
.
TRT_NOT_IMPLEMENTED
,
"It is not support that strides is not equal [1, 1] in dynamic mode for trt now."
)
def
test
(
self
):
self
.
add_skip_trt_case
()
self
.
run_test
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录