Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
Paddle
提交
5c7c6b1e
P
Paddle
项目概览
BaiXuePrincess
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
5c7c6b1e
编写于
12月 03, 2019
作者:
石
石晓伟
提交者:
GitHub
12月 03, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
revert ProgOptimUnsupported check, test=release/1.6 (#21475)
上级
badaaee6
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
0 addition
and
58 deletion
+0
-58
paddle/fluid/framework/op_compatible_info.cc
paddle/fluid/framework/op_compatible_info.cc
+0
-45
paddle/fluid/framework/op_compatible_info.h
paddle/fluid/framework/op_compatible_info.h
+0
-5
paddle/fluid/inference/api/analysis_predictor.cc
paddle/fluid/inference/api/analysis_predictor.cc
+0
-8
未找到文件。
paddle/fluid/framework/op_compatible_info.cc
浏览文件 @
5c7c6b1e
...
...
@@ -215,50 +215,5 @@ bool OpCompatibleMap::ReadFromProto(const proto::OpCompatibleMap& desc) {
return
true
;
}
bool
ProgOptimUnsupported
(
std
::
shared_ptr
<
framework
::
ProgramDesc
>
program
)
{
auto
op_type_checker
=
[](
const
std
::
string
&
name
)
{
const
std
::
vector
<
std
::
string
>
op_types
({
"conv2d"
,
"conv3d"
,
"conv2d_transpose"
,
"conv3d_transpose"
,
"depthwise_conv2d"
,
"depthwise_conv2d_transpose"
,
"pool2d"
,
"pool3d"
,
});
return
std
::
find
(
op_types
.
begin
(),
op_types
.
end
(),
name
)
!=
op_types
.
end
();
};
auto
checker
=
[](
const
framework
::
OpDesc
&
op
)
{
if
(
op
.
HasAttr
(
"paddings"
)
&&
op
.
HasAttr
(
"strides"
))
{
auto
paddings
=
boost
::
get
<
std
::
vector
<
int
>>
(
op
.
GetAttr
(
"paddings"
));
auto
strides
=
boost
::
get
<
std
::
vector
<
int
>>
(
op
.
GetAttr
(
"strides"
));
if
(
paddings
.
size
()
!=
strides
.
size
())
{
VLOG
(
3
)
<<
"== paddings size is not equal to strides size."
;
return
true
;
}
}
if
(
op
.
HasAttr
(
"data_format"
))
{
auto
data_format
=
boost
::
get
<
std
::
string
>
(
op
.
GetAttr
(
"data_format"
));
if
(
data_format
==
"NHWC"
||
data_format
==
"NDHWC"
)
{
VLOG
(
3
)
<<
"== data_format is NHWC or NDHWC."
;
return
true
;
}
}
if
(
op
.
HasAttr
(
"padding_algorithm"
))
{
auto
padding_algorithm
=
boost
::
get
<
std
::
string
>
(
op
.
GetAttr
(
"padding_algorithm"
));
if
(
padding_algorithm
!=
"EXPLICIT"
)
{
VLOG
(
3
)
<<
"== padding_algorithm is not EXPLICIT."
;
return
true
;
}
}
return
false
;
};
for
(
size_t
i
=
0
;
i
<
program
->
Size
();
i
++
)
{
const
auto
&
block
=
program
->
Block
(
i
);
for
(
auto
*
op
:
block
.
AllOps
())
{
if
((
op_type_checker
(
op
->
Type
()))
&&
checker
(
*
op
))
{
return
true
;
}
}
}
return
false
;
}
}
// namespace framework
}
// namespace paddle
paddle/fluid/framework/op_compatible_info.h
浏览文件 @
5c7c6b1e
...
...
@@ -13,7 +13,6 @@
// limitations under the License.
#include <map>
#include <memory>
#include <string>
#include "paddle/fluid/framework/program_desc.h"
...
...
@@ -71,9 +70,5 @@ class OpCompatibleMap {
std
::
string
default_required_version_
;
};
// Determine if the model contains operators that the optimization cannot
// support.
bool
ProgOptimUnsupported
(
std
::
shared_ptr
<
framework
::
ProgramDesc
>
program
);
}
// namespace framework
}
// namespace paddle
paddle/fluid/inference/api/analysis_predictor.cc
浏览文件 @
5c7c6b1e
...
...
@@ -458,14 +458,6 @@ void AnalysisPredictor::PrepareArgument() {
// NOTE All the members in AnalysisConfig should be copied to Argument.
void
AnalysisPredictor
::
OptimizeInferenceProgram
()
{
if
(
ProgOptimUnsupported
(
inference_program_
))
{
LOG
(
INFO
)
<<
"NOTICE: Your inference model contains parameters such "
"as asymmetric padding, and ir optimization is temporarily "
"not supported, "
"so it is turned off."
;
config_
.
SwitchIrOptim
(
false
);
argument_
.
SetEnableAnalysisOptim
(
false
);
}
PrepareArgument
();
Analyzer
().
Run
(
&
argument_
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录