Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle-Lite
提交
a4b881dd
P
Paddle-Lite
项目概览
PaddlePaddle
/
Paddle-Lite
通知
331
Star
4
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
271
列表
看板
标记
里程碑
合并请求
78
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle-Lite
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
271
Issue
271
列表
看板
标记
里程碑
合并请求
78
合并请求
78
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
a4b881dd
编写于
4月 29, 2020
作者:
C
chenhaoze
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix bugs. test=develop
上级
6df6fd08
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
15 addition
and
11 deletion
+15
-11
lite/api/cxx_api.h
lite/api/cxx_api.h
+8
-7
lite/api/cxx_api_impl.cc
lite/api/cxx_api_impl.cc
+1
-1
lite/api/light_api.h
lite/api/light_api.h
+2
-1
lite/api/light_api_impl.cc
lite/api/light_api_impl.cc
+2
-1
lite/api/paddle_api.h
lite/api/paddle_api.h
+2
-1
未找到文件。
lite/api/cxx_api.h
浏览文件 @
a4b881dd
...
...
@@ -81,16 +81,16 @@ class LITE_API Predictor {
const
std
::
vector
<
std
::
string
>&
passes
=
{});
std
::
shared_ptr
<
Predictor
>
Clone
(
co
snst
std
::
vector
<
std
::
string
>
var_names
)
const
{
co
nst
std
::
vector
<
std
::
string
>&
var_names
)
const
{
// CHECK(program_desc_) << "Both program and scope of current predicotr
// should be not be nullptr in Clone mode." ;
// CHECK(scope_) << "Both program and scope of current predicotr should
// be not be nullptr in Clone mode.";
for
(
auto
i
:
var_names
)
{
exec_scope_
->
Var
(
i
);
auto
*
tensor
=
scope_
->
Var
(
i
)
->
GetMutable
<
lite
::
Tensor
>
();
auto
*
sub_tensor
=
exec_scope_
->
Var
(
i
)
->
GetMutable
<
lite
::
Tensor
>
();
sub_tensor
->
CopyDataFrom
(
tensor
);
this
->
exec_scope_
->
Var
(
i
);
auto
*
tensor
=
this
->
scope_
->
Var
(
i
)
->
GetMutable
<
lite
::
Tensor
>
();
auto
*
sub_tensor
=
this
->
exec_scope_
->
Var
(
i
)
->
GetMutable
<
lite
::
Tensor
>
();
sub_tensor
->
CopyDataFrom
(
*
tensor
);
}
auto
predictor
=
std
::
make_shared
<
Predictor
>
(
program_desc_
,
scope_
,
valid_places_
);
...
...
@@ -150,7 +150,7 @@ class LITE_API Predictor {
Optimizer
optimizer_
;
std
::
shared_ptr
<
cpp
::
ProgramDesc
>
program_desc_
;
std
::
shared_ptr
<
Scope
>
scope_
;
const
Scope
*
exec_scope_
;
Scope
*
exec_scope_
;
std
::
unique_ptr
<
RuntimeProgram
>
program_
;
bool
program_generated_
{
false
};
std
::
vector
<
std
::
string
>
input_names_
;
...
...
@@ -173,7 +173,8 @@ class CxxPaddleApiImpl : public lite_api::PaddlePredictor {
void
Run
()
override
;
std
::
shared_ptr
<
lite_api
::
PaddlePredictor
>
Clone
()
override
;
std
::
shared_ptr
<
lite_api
::
PaddlePredictor
>
Clone
(
const
std
::
vector
<
std
::
string
>&
var_names
);
std
::
string
GetVersion
()
const
override
;
...
...
lite/api/cxx_api_impl.cc
浏览文件 @
a4b881dd
...
...
@@ -120,7 +120,7 @@ void CxxPaddleApiImpl::Run() {
}
std
::
shared_ptr
<
lite_api
::
PaddlePredictor
>
CxxPaddleApiImpl
::
Clone
(
co
snst
std
::
vector
<
std
::
string
>
var_names
)
{
co
nst
std
::
vector
<
std
::
string
>
&
var_names
)
{
std
::
lock_guard
<
std
::
mutex
>
lock
(
mutex_
);
auto
predictor
=
std
::
make_shared
<
lite
::
CxxPaddleApiImpl
>
(
raw_predictor_
->
Clone
(
var_names
));
...
...
lite/api/light_api.h
浏览文件 @
a4b881dd
...
...
@@ -113,7 +113,8 @@ class LightPredictorImpl : public lite_api::PaddlePredictor {
void
Run
()
override
;
std
::
shared_ptr
<
lite_api
::
PaddlePredictor
>
Clone
()
override
;
std
::
shared_ptr
<
lite_api
::
PaddlePredictor
>
Clone
(
const
std
::
vector
<
std
::
string
>&
var_names
);
std
::
string
GetVersion
()
const
override
;
std
::
vector
<
std
::
string
>
GetInputNames
()
override
;
...
...
lite/api/light_api_impl.cc
浏览文件 @
a4b881dd
...
...
@@ -56,7 +56,8 @@ void LightPredictorImpl::Run() {
raw_predictor_
->
Run
();
}
std
::
shared_ptr
<
lite_api
::
PaddlePredictor
>
LightPredictorImpl
::
Clone
()
{
std
::
shared_ptr
<
lite_api
::
PaddlePredictor
>
LightPredictorImpl
::
Clone
(
const
std
::
vector
<
std
::
string
>&
var_names
)
{
LOG
(
FATAL
)
<<
"The Clone API is not supported in LigthPredictor"
;
return
nullptr
;
}
...
...
lite/api/paddle_api.h
浏览文件 @
a4b881dd
...
...
@@ -78,7 +78,8 @@ class LITE_API PaddlePredictor {
virtual
std
::
unique_ptr
<
const
Tensor
>
GetOutput
(
int
i
)
const
=
0
;
virtual
void
Run
()
=
0
;
virtual
std
::
shared_ptr
<
PaddlePredictor
>
Clone
()
=
0
;
virtual
std
::
shared_ptr
<
PaddlePredictor
>
Clone
(
const
std
::
vector
<
std
::
string
>&
var_names
)
=
0
;
virtual
std
::
string
GetVersion
()
const
=
0
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录