[Python lib] Add opt lib into python lib #3209
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
【本PR工作】:将原先opt工具的功能封装为
opt_base
类,进而将opt_base
类封装为Python预测库的接口.【本PR的主要改动】:
1、opt编译时将所有的kernel的注册信息保存到
all_kernel_fake.cc
文件。 为了与lite核心库融合,需改为all_kernel_fake.cc
中保存非x86backends的kernels注册信息。opt需要同时引用paddle_use_kernels.h
和all_kernel_fake.cc
2、将
opt.cc
的主要功能整理到opt_base.cc
中opt_base
类中3、在
build.sh
的x86编译选项中加入build_python
,可以编译Python预测库4、为
LightPredictorImpl::Clone()
函数添加默认返回值。