Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Crayon鑫
Paddle
提交
da43e065
P
Paddle
项目概览
Crayon鑫
/
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看板
未验证
提交
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,
...
@@ -560,12 +560,14 @@ bool OpTeller::Tell(const framework::ir::Node* node, bool use_no_calib_int8,
"the pass."
;
"the pass."
;
return
false
;
return
false
;
}
}
#if !IS_TRT_VERSION_GE(7000)
auto
*
x_var_desc
=
block
->
FindVar
(
desc
.
Input
(
"X"
)[
0
]);
auto
*
x_var_desc
=
block
->
FindVar
(
desc
.
Input
(
"X"
)[
0
]);
const
auto
x_shape
=
x_var_desc
->
GetShape
();
const
auto
x_shape
=
x_var_desc
->
GetShape
();
if
(
x_shape
.
size
()
==
1
)
{
if
(
x_shape
.
size
()
==
1
)
{
VLOG
(
3
)
<<
"Gather does not support 1-dimensional input in tensorrt"
;
VLOG
(
3
)
<<
"Gather does not support 1-dimensional input in tensorrt"
;
return
false
;
return
false
;
}
}
#endif
}
}
}
}
...
...
python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_gather.py
浏览文件 @
da43e065
...
@@ -155,7 +155,7 @@ class TrtConvertGatherTest(TrtLayerAutoScanTest):
...
@@ -155,7 +155,7 @@ class TrtConvertGatherTest(TrtLayerAutoScanTest):
if
self
.
input_num
==
3
:
if
self
.
input_num
==
3
:
return
0
,
5
return
0
,
5
else
:
else
:
if
dynamic_shape
and
self
.
axis
==
0
:
if
dynamic_shape
:
return
1
,
3
return
1
,
3
else
:
else
:
return
0
,
4
return
0
,
4
...
@@ -179,9 +179,12 @@ class TrtConvertGatherTest(TrtLayerAutoScanTest):
...
@@ -179,9 +179,12 @@ class TrtConvertGatherTest(TrtLayerAutoScanTest):
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
True
),
1e-5
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
True
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
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
add_skip_trt_case
(
self
):
ver
=
paddle_infer
.
get_trt_compile_version
()
if
ver
[
0
]
*
1000
+
ver
[
1
]
*
100
+
ver
[
0
]
*
10
<
7000
:
def
teller1
(
program_config
,
predictor_config
):
def
teller1
(
program_config
,
predictor_config
):
if
len
(
self
.
dynamic_shape
.
min_input_shape
)
!=
0
:
if
len
(
self
.
dynamic_shape
.
min_input_shape
)
!=
0
:
inputs
=
program_config
.
inputs
inputs
=
program_config
.
inputs
...
@@ -192,19 +195,9 @@ class TrtConvertGatherTest(TrtLayerAutoScanTest):
...
@@ -192,19 +195,9 @@ class TrtConvertGatherTest(TrtLayerAutoScanTest):
self
.
add_skip_case
(
self
.
add_skip_case
(
teller1
,
SkipReasons
.
TRT_NOT_SUPPORT
,
teller1
,
SkipReasons
.
TRT_NOT_SUPPORT
,
"Need to repair the case: trt reshape out failed for dynamic shape mode when inputs' dims==1.
"
"Need to repair the case: trt reshape out failed for dynamic shape mode when inputs' dims==1. under trt7.0
"
)
)
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."
)
def
test
(
self
):
def
test
(
self
):
self
.
add_skip_trt_case
()
self
.
add_skip_trt_case
()
self
.
run_test
()
self
.
run_test
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录