Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle-Lite
提交
f18f4bbd
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看板
提交
f18f4bbd
编写于
3月 04, 2019
作者:
Z
zhangyang0701
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
change function names to avoid ambiguity for FPGA track
上级
17c42bdf
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
14 addition
and
12 deletion
+14
-12
src/framework/executor.cpp
src/framework/executor.cpp
+3
-2
src/framework/executor.h
src/framework/executor.h
+2
-2
src/io/api_paddle_mobile.cc
src/io/api_paddle_mobile.cc
+2
-2
src/io/paddle_mobile.cpp
src/io/paddle_mobile.cpp
+5
-4
src/io/paddle_mobile.h
src/io/paddle_mobile.h
+2
-2
未找到文件。
src/framework/executor.cpp
浏览文件 @
f18f4bbd
...
...
@@ -476,7 +476,7 @@ void Executor<Device, T>::FeedData(const std::vector<void *> &v) {
}
template
<
typename
Device
,
typename
T
>
void
Executor
<
Device
,
T
>::
FeedData
(
const
vector
<
framework
::
Tensor
>
&
v
)
{
void
Executor
<
Device
,
T
>::
Feed
Tensor
Data
(
const
vector
<
framework
::
Tensor
>
&
v
)
{
auto
input_size
=
v
.
size
();
auto
vars
=
program_
.
scope
->
VarContain
(
"feed"
);
PADDLE_MOBILE_ENFORCE
(
input_size
==
vars
.
size
(),
...
...
@@ -503,7 +503,8 @@ void Executor<Device, T>::GetResults(std::vector<void *> *v) {
}
template
<
typename
Device
,
typename
T
>
void
Executor
<
Device
,
T
>::
GetResults
(
std
::
vector
<
framework
::
Tensor
*>
*
v
)
{
void
Executor
<
Device
,
T
>::
GetTensorResults
(
std
::
vector
<
framework
::
Tensor
*>
*
v
)
{
auto
output_size
=
v
->
size
();
PADDLE_MOBILE_ENFORCE
(
output_size
>
0
,
"Empty output"
);
auto
vars
=
program_
.
scope
->
VarContain
(
"fetch"
);
...
...
src/framework/executor.h
浏览文件 @
f18f4bbd
...
...
@@ -53,10 +53,10 @@ class Executor {
void
InjectVariable
(
const
Tensor
&
t
,
std
::
string
var_name
);
void
FeedData
(
const
Tensor
&
t
);
void
FeedData
(
const
std
::
vector
<
void
*>
&
v
);
void
FeedData
(
const
std
::
vector
<
framework
::
Tensor
>
&
v
);
void
Feed
Tensor
Data
(
const
std
::
vector
<
framework
::
Tensor
>
&
v
);
void
GetResults
(
std
::
vector
<
void
*>
*
v
);
void
GetResults
(
std
::
vector
<
framework
::
Tensor
*>
*
v
);
void
Get
Tensor
Results
(
std
::
vector
<
framework
::
Tensor
*>
*
v
);
std
::
shared_ptr
<
Tensor
>
FetchResult
(
int
id
=
-
1
);
void
Predict_From_To
(
int
start
=
0
,
int
end
=
-
1
);
...
...
src/io/api_paddle_mobile.cc
浏览文件 @
f18f4bbd
...
...
@@ -145,7 +145,7 @@ void PaddleMobilePredictor<Device, T>::FeedPaddleTensors(
tensors
[
i
].
init
(
typeid
(
float
));
ConvertPaddleTensors
(
inputs
[
i
],
&
tensors
[
i
]);
}
paddle_mobile_
->
FeedData
(
tensors
);
paddle_mobile_
->
Feed
Tensor
Data
(
tensors
);
}
template
<
typename
Device
,
typename
T
>
...
...
@@ -154,7 +154,7 @@ void PaddleMobilePredictor<Device, T>::FetchPaddleTensors(
auto
num
=
outputs
->
size
();
PADDLE_MOBILE_ENFORCE
(
num
>
0
,
"0 output pointers is not permitted"
);
std
::
vector
<
framework
::
Tensor
*>
tensors
(
num
,
nullptr
);
paddle_mobile_
->
GetResults
(
&
tensors
);
paddle_mobile_
->
Get
Tensor
Results
(
&
tensors
);
for
(
int
i
=
0
;
i
<
num
;
i
++
)
{
ConvertTensors
(
*
tensors
[
i
],
&
(
*
outputs
)[
i
]);
}
...
...
src/io/paddle_mobile.cpp
浏览文件 @
f18f4bbd
...
...
@@ -233,9 +233,9 @@ void PaddleMobile<Device, T>::FeedData(const std::vector<void *> &v) {
};
template
<
typename
Device
,
typename
T
>
void
PaddleMobile
<
Device
,
T
>::
FeedData
(
void
PaddleMobile
<
Device
,
T
>::
Feed
Tensor
Data
(
const
std
::
vector
<
framework
::
Tensor
>
&
v
)
{
executor_
->
FeedData
(
v
);
executor_
->
Feed
Tensor
Data
(
v
);
};
template
<
typename
Device
,
typename
T
>
...
...
@@ -244,8 +244,9 @@ void PaddleMobile<Device, T>::GetResults(std::vector<void *> *v) {
}
template
<
typename
Device
,
typename
T
>
void
PaddleMobile
<
Device
,
T
>::
GetResults
(
std
::
vector
<
framework
::
Tensor
*>
*
v
)
{
executor_
->
GetResults
(
v
);
void
PaddleMobile
<
Device
,
T
>::
GetTensorResults
(
std
::
vector
<
framework
::
Tensor
*>
*
v
)
{
executor_
->
GetTensorResults
(
v
);
}
template
<
typename
Device
,
typename
T
>
...
...
src/io/paddle_mobile.h
浏览文件 @
f18f4bbd
...
...
@@ -91,10 +91,10 @@ class PaddleMobile {
void
InjectVariable
(
const
framework
::
Tensor
&
t
,
std
::
string
var_name
);
void
FeedData
(
const
framework
::
Tensor
&
t
);
void
FeedData
(
const
std
::
vector
<
void
*>
&
v
);
void
FeedData
(
const
std
::
vector
<
framework
::
Tensor
>
&
v
);
void
Feed
Tensor
Data
(
const
std
::
vector
<
framework
::
Tensor
>
&
v
);
void
GetResults
(
std
::
vector
<
void
*>
*
v
);
void
GetResults
(
std
::
vector
<
framework
::
Tensor
*>
*
v
);
void
Get
Tensor
Results
(
std
::
vector
<
framework
::
Tensor
*>
*
v
);
std
::
shared_ptr
<
framework
::
Tensor
>
FetchResult
(
int
id
=
-
1
);
void
Predict_From_To
(
int
start
=
0
,
int
end
=
-
1
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录