Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle-Lite
提交
ed4e3db8
P
Paddle-Lite
项目概览
PaddlePaddle
/
Paddle-Lite
通知
338
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看板
提交
ed4e3db8
编写于
3月 20, 2020
作者:
D
DannyIsFunny
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
test=develop
上级
b42cd1d4
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
5 addition
and
7 deletion
+5
-7
lite/api/cxx_api.cc
lite/api/cxx_api.cc
+1
-1
lite/core/scope.cc
lite/core/scope.cc
+2
-4
lite/core/scope.h
lite/core/scope.h
+2
-2
未找到文件。
lite/api/cxx_api.cc
浏览文件 @
ed4e3db8
...
@@ -152,7 +152,7 @@ std::vector<std::string> Predictor::GetOutputNames() { return output_names_; }
...
@@ -152,7 +152,7 @@ std::vector<std::string> Predictor::GetOutputNames() { return output_names_; }
// get param names
// get param names
std
::
vector
<
std
::
string
>
Predictor
::
GetParamNames
()
{
std
::
vector
<
std
::
string
>
Predictor
::
GetParamNames
()
{
return
exec_scope_
->
VarNames
();
return
exec_scope_
->
Attribute
VarNames
();
}
}
// append the names of inputs and outputs into input_names_ and output_names_
// append the names of inputs and outputs into input_names_ and output_names_
...
...
lite/core/scope.cc
浏览文件 @
ed4e3db8
...
@@ -60,14 +60,12 @@ Variable *Scope::FindLocalVar(const std::string &name) const {
...
@@ -60,14 +60,12 @@ Variable *Scope::FindLocalVar(const std::string &name) const {
return
nullptr
;
return
nullptr
;
}
}
std
::
vector
<
std
::
string
>
Scope
::
VarNames
()
const
{
std
::
vector
<
std
::
string
>
Scope
::
Attribute
VarNames
()
const
{
std
::
vector
<
std
::
string
>
resulted_keys
;
std
::
vector
<
std
::
string
>
resulted_keys
;
auto
keys
=
LocalVarNames
();
resulted_keys
.
insert
(
resulted_keys
.
end
(),
keys
.
begin
(),
keys
.
end
());
const
Scope
*
cur_scope
=
this
;
const
Scope
*
cur_scope
=
this
;
while
(
cur_scope
->
parent
())
{
while
(
cur_scope
->
parent
())
{
cur_scope
=
cur_scope
->
parent
();
cur_scope
=
cur_scope
->
parent
();
keys
=
cur_scope
->
LocalVarNames
();
auto
keys
=
cur_scope
->
LocalVarNames
();
resulted_keys
.
insert
(
resulted_keys
.
end
(),
keys
.
begin
(),
keys
.
end
());
resulted_keys
.
insert
(
resulted_keys
.
end
(),
keys
.
begin
(),
keys
.
end
());
}
}
return
resulted_keys
;
return
resulted_keys
;
...
...
lite/core/scope.h
浏览文件 @
ed4e3db8
...
@@ -45,8 +45,8 @@ class Scope final {
...
@@ -45,8 +45,8 @@ class Scope final {
const
Scope
*
parent
()
const
{
return
parent_
;
}
const
Scope
*
parent
()
const
{
return
parent_
;
}
// Get a
ll params in each scope
.
// Get a
ttribute params stored in parent scopes
.
std
::
vector
<
std
::
string
>
VarNames
()
const
;
std
::
vector
<
std
::
string
>
Attribute
VarNames
()
const
;
// Following the legacy scope interface.
// Following the legacy scope interface.
std
::
vector
<
std
::
string
>
LocalVarNames
()
const
;
std
::
vector
<
std
::
string
>
LocalVarNames
()
const
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录