Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
da43e065
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看板
未验证
提交
da43e065
编写于
2月 22, 2022
作者:
F
feng_shuai
提交者:
GitHub
2月 22, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
delete gather_ut skip_case (#39657)
* delete gather_ut skip_case * add trt version limit
上级
f33ae206
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
19 addition
and
24 deletion
+19
-24
paddle/fluid/inference/tensorrt/op_teller.cc
paddle/fluid/inference/tensorrt/op_teller.cc
+2
-0
python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_gather.py
...d/tests/unittests/ir/inference/test_trt_convert_gather.py
+17
-24
未找到文件。
paddle/fluid/inference/tensorrt/op_teller.cc
浏览文件 @
da43e065
...
...
@@ -560,12 +560,14 @@ bool OpTeller::Tell(const framework::ir::Node* node, bool use_no_calib_int8,
"the pass."
;
return
false
;
}
#if !IS_TRT_VERSION_GE(7000)
auto
*
x_var_desc
=
block
->
FindVar
(
desc
.
Input
(
"X"
)[
0
]);
const
auto
x_shape
=
x_var_desc
->
GetShape
();
if
(
x_shape
.
size
()
==
1
)
{
VLOG
(
3
)
<<
"Gather does not support 1-dimensional input in tensorrt"
;
return
false
;
}
#endif
}
}
...
...
python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_gather.py
浏览文件 @
da43e065
...
...
@@ -155,7 +155,7 @@ class TrtConvertGatherTest(TrtLayerAutoScanTest):
if
self
.
input_num
==
3
:
return
0
,
5
else
:
if
dynamic_shape
and
self
.
axis
==
0
:
if
dynamic_shape
:
return
1
,
3
else
:
return
0
,
4
...
...
@@ -179,31 +179,24 @@ class TrtConvertGatherTest(TrtLayerAutoScanTest):
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
True
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
True
),
1e-
5
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
True
),
1e-
3
def
add_skip_trt_case
(
self
):
def
teller1
(
program_config
,
predictor_config
):
if
len
(
self
.
dynamic_shape
.
min_input_shape
)
!=
0
:
inputs
=
program_config
.
inputs
if
len
(
inputs
[
'input_data'
].
shape
)
==
1
or
len
(
inputs
[
'index_data'
].
shape
)
==
1
:
return
True
return
False
self
.
add_skip_case
(
teller1
,
SkipReasons
.
TRT_NOT_SUPPORT
,
"Need to repair the case: trt reshape out failed for dynamic shape mode when inputs' dims==1."
)
def
teller2
(
program_config
,
predictor_config
):
inputs
=
program_config
.
inputs
if
"axis_data"
in
inputs
.
keys
():
return
True
return
False
self
.
add_skip_case
(
teller2
,
SkipReasons
.
TRT_NOT_SUPPORT
,
"Need to repair the case: trt do not support axis tensor input."
)
ver
=
paddle_infer
.
get_trt_compile_version
()
if
ver
[
0
]
*
1000
+
ver
[
1
]
*
100
+
ver
[
0
]
*
10
<
7000
:
def
teller1
(
program_config
,
predictor_config
):
if
len
(
self
.
dynamic_shape
.
min_input_shape
)
!=
0
:
inputs
=
program_config
.
inputs
if
len
(
inputs
[
'input_data'
].
shape
)
==
1
or
len
(
inputs
[
'index_data'
].
shape
)
==
1
:
return
True
return
False
self
.
add_skip_case
(
teller1
,
SkipReasons
.
TRT_NOT_SUPPORT
,
"Need to repair the case: trt reshape out failed for dynamic shape mode when inputs' dims==1. under trt7.0 "
)
def
test
(
self
):
self
.
add_skip_trt_case
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录