Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
2a94b817
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看板
未验证
提交
2a94b817
编写于
5月 16, 2023
作者:
Z
Zhang Jun
提交者:
GitHub
5月 16, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[inference][trt]Remove unused code from teller.cc (#53758)
* remove unused code
上级
00c21abc
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
1 addition
and
103 deletion
+1
-103
paddle/fluid/inference/tensorrt/op_teller.cc
paddle/fluid/inference/tensorrt/op_teller.cc
+1
-103
未找到文件。
paddle/fluid/inference/tensorrt/op_teller.cc
浏览文件 @
2a94b817
...
...
@@ -416,12 +416,6 @@ struct SimpleOpTypeSetTeller : public Teller {
auto
x_var_name
=
desc
.
Input
(
"X"
)[
0
];
auto
*
x_var_desc
=
block
->
FindVar
(
x_var_name
);
const
auto
x_shape
=
x_var_desc
->
GetShape
();
if
(
!
with_dynamic_shape
&&
(
x_shape
.
size
()
==
1
||
x_shape
.
size
()
==
0
))
{
VLOG
(
3
)
<<
op_type
<<
" op does not support input's dim is 1 or 0 in tensorrt "
"with static shape."
;
return
false
;
}
if
(
with_dynamic_shape
&&
(
x_shape
.
size
()
==
1
||
x_shape
.
size
()
==
0
))
{
int
axis
=
desc
.
HasAttr
(
"axis"
)
...
...
@@ -1198,11 +1192,6 @@ struct SimpleOpTypeSetTeller : public Teller {
dtype
==
framework
::
proto
::
VarType
::
FP16
))
{
return
false
;
}
if
(
x_shape
.
size
()
==
1
||
x_shape
.
size
()
==
0
)
{
VLOG
(
3
)
<<
"Scale op does not support 0 or 1-dimensional input in "
"tensorrt"
;
return
false
;
}
}
else
{
// At present, only support float32 or float16 or int32 or int64 into
// trt.
...
...
@@ -1527,13 +1516,7 @@ struct SimpleOpTypeSetTeller : public Teller {
return
false
;
}
auto
*
x_var_desc
=
block
->
FindVar
(
desc
.
Input
(
"X"
)[
0
]);
const
auto
x_shape
=
x_var_desc
->
GetShape
();
if
(
!
with_dynamic_shape
&&
(
x_shape
.
size
()
==
1
||
x_shape
.
size
()
==
0
))
{
VLOG
(
3
)
<<
op_type
<<
" op does not support input's dim is 1 or 0 in tensorrt "
"static shape mode."
;
return
false
;
}
// the same as `elementwise_pow`.
if
(
x_var_desc
->
GetDataType
()
==
paddle
::
framework
::
proto
::
VarType_Type
::
VarType_Type_INT32
)
{
...
...
@@ -1572,26 +1555,6 @@ struct SimpleOpTypeSetTeller : public Teller {
}
}
if
(
op_type
==
"sum"
)
{
auto
*
block
=
desc
.
Block
();
if
(
block
==
nullptr
)
{
VLOG
(
3
)
<<
"The block desc is nullptr, we can't continue to analyze. "
"Developers need to check whether block_desc is passed in "
"the pass."
;
return
false
;
}
auto
x_var_name
=
desc
.
Input
(
"X"
)[
0
];
auto
*
x_var
=
block
->
FindVar
(
x_var_name
);
const
auto
x_shape
=
x_var
->
GetShape
();
if
(
!
with_dynamic_shape
&&
(
x_shape
.
size
()
==
0
||
x_shape
.
size
()
==
1
))
{
VLOG
(
3
)
<<
op_type
<<
" op does not support input's dim is 0 or 1 in tensorrt "
"with static shape."
;
return
false
;
}
return
true
;
}
if
(
op_type
==
"shape"
&&
!
with_dynamic_shape
)
{
return
false
;
}
...
...
@@ -1657,24 +1620,6 @@ struct SimpleOpTypeSetTeller : public Teller {
if
(
PADDLE_GET_CONST
(
bool
,
desc
.
GetAttr
(
"approximate"
)))
return
false
;
}
#endif
auto
*
block
=
desc
.
Block
();
if
(
block
==
nullptr
)
{
VLOG
(
3
)
<<
"The block desc is nullptr, we can't continue to analyze. "
"Developers need to check whether block_desc is passed in "
"the pass."
;
return
false
;
}
auto
x_var_name
=
desc
.
Input
(
"X"
)[
0
];
auto
*
x_var_desc
=
block
->
FindVar
(
x_var_name
);
const
auto
x_shape
=
x_var_desc
->
GetShape
();
if
(
!
with_dynamic_shape
&&
(
x_shape
.
size
()
==
1
||
x_shape
.
size
()
==
0
))
{
VLOG
(
3
)
<<
op_type
<<
"gelu op does not support input's dim is 1 or 0 in tensorrt "
"static shape mode."
;
return
false
;
}
}
if
(
op_type
==
"layer_norm"
)
{
...
...
@@ -1864,16 +1809,6 @@ struct SimpleOpTypeSetTeller : public Teller {
"static shape mode."
;
return
false
;
}
auto
x_var_name
=
desc
.
Input
(
"X"
)[
0
];
auto
*
x_var
=
block
->
FindVar
(
x_var_name
);
const
auto
x_shape
=
x_var
->
GetShape
();
if
(
!
with_dynamic_shape
&&
(
x_shape
.
size
()
==
1
||
x_shape
.
size
()
==
0
))
{
VLOG
(
3
)
<<
op_type
<<
" op does not support input's dim is 1 or 0 in tensorrt "
"with static shape."
;
return
false
;
}
}
if
(
op_type
==
"mish"
)
{
...
...
@@ -1889,24 +1824,6 @@ struct SimpleOpTypeSetTeller : public Teller {
<<
desc
.
Output
(
"Out"
).
size
()
<<
"."
;
return
false
;
}
auto
*
block
=
desc
.
Block
();
if
(
block
==
nullptr
)
{
VLOG
(
3
)
<<
"The block desc is nullptr, we can't continue to analyze. "
"Developers need to check whether block_desc is passed in "
"the pass."
;
return
false
;
}
auto
x_var_name
=
desc
.
Input
(
"X"
)[
0
];
auto
*
x_var_desc
=
block
->
FindVar
(
x_var_name
);
const
auto
x_shape
=
x_var_desc
->
GetShape
();
if
((
!
with_dynamic_shape
&&
x_shape
.
size
()
==
1
)
||
x_shape
.
size
()
==
0
)
{
VLOG
(
3
)
<<
op_type
<<
"mish op does not support input's dim is 1 in tensorrt "
"static shape mode or 0."
;
return
false
;
}
}
if
(
op_type
==
"roi_align"
)
{
...
...
@@ -2194,25 +2111,6 @@ struct SimpleOpTypeSetTeller : public Teller {
}
}
if
(
op_type
==
"square"
)
{
auto
*
block
=
desc
.
Block
();
if
(
block
==
nullptr
)
{
VLOG
(
3
)
<<
"The block desc is nullptr, we can't continue to analyze. "
"Developers need to check whether block_desc is passed in "
"the pass."
;
return
false
;
}
auto
x_var_name
=
desc
.
Input
(
"X"
)[
0
];
auto
*
x_var
=
block
->
FindVar
(
x_var_name
);
const
auto
x_shape
=
x_var
->
GetShape
();
if
(
!
with_dynamic_shape
&&
x_shape
.
size
()
==
0
)
{
VLOG
(
3
)
<<
op_type
<<
" op does not support input's dim is 0 in tensorrt "
"with static shape."
;
return
false
;
}
}
if
(
op_type
==
"clip"
)
{
// Paddle-TRT does not support the input tensors: Min and Max
auto
clip_inputs
=
desc
.
Inputs
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录