Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle-Lite
提交
ca32dc7f
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看板
未验证
提交
ca32dc7f
编写于
9月 28, 2018
作者:
C
Chon
提交者:
GitHub
9月 28, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1017 from zhangyang0701/develop
correct mistakes for FPGA track
#1016
上级
7fb2c84e
df00aee0
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
11 addition
and
9 deletion
+11
-9
src/fpga/api.cpp
src/fpga/api.cpp
+2
-0
src/io/executor.cpp
src/io/executor.cpp
+5
-5
src/operators/feed_op.h
src/operators/feed_op.h
+1
-1
src/operators/kernel/fpga/concat_kernel.cpp
src/operators/kernel/fpga/concat_kernel.cpp
+1
-1
src/operators/kernel/fpga/softmax_kernel.cpp
src/operators/kernel/fpga/softmax_kernel.cpp
+2
-2
未找到文件。
src/fpga/api.cpp
浏览文件 @
ca32dc7f
...
...
@@ -311,6 +311,8 @@ int get_aligned_filter_num(int num) {
void
format_filter
(
framework
::
Tensor
*
filter_tensor
,
float
max_value
,
int
group_num
)
{
filter_tensor
->
scale
[
0
]
=
float
(
max_value
/
127.0
);
filter_tensor
->
scale
[
1
]
=
float
(
127.0
/
max_value
);
auto
dims
=
filter_tensor
->
dims
();
auto
num
=
dims
[
0
],
channel
=
dims
[
1
],
height
=
dims
[
2
],
width
=
dims
[
3
];
auto
data_ptr
=
filter_tensor
->
data
<
float
>
();
...
...
src/io/executor.cpp
浏览文件 @
ca32dc7f
...
...
@@ -676,11 +676,11 @@ std::shared_ptr<framework::Tensor> Executor<Dtype, P>::FetchResult(int id) {
to_predict_program_
->
Block
(
0
);
auto
&
ops
=
ops_of_block_
[
*
to_predict_block
.
get
()];
PADDLE_MOBILE_ENFORCE
(
id
<
ops
.
size
(),
"Index out of range"
);
auto
last_
op
=
id
<
0
?
ops
[
ops
.
size
()
-
1
]
:
ops
[
id
];
auto
output_map
=
last_
op
->
Outputs
();
std
::
vector
<
std
::
string
>
out_keys
=
last_
op
->
GetOutKeys
();
PADDLE_MOBILE_ENFORCE
(
!
out_keys
.
empty
(),
"th
e last
op contains no output"
);
PADDLE_MOBILE_ENFORCE
(
id
<
(
int
)
ops
.
size
(),
"Index out of range"
);
auto
op
=
id
<
0
?
ops
[
ops
.
size
()
-
1
]
:
ops
[
id
];
auto
output_map
=
op
->
Outputs
();
std
::
vector
<
std
::
string
>
out_keys
=
op
->
GetOutKeys
();
PADDLE_MOBILE_ENFORCE
(
!
out_keys
.
empty
(),
"th
is
op contains no output"
);
auto
*
output_tensor
=
framework
::
GetVarValue
<
framework
::
LoDTensor
>
(
out_keys
[
0
],
output_map
,
*
(
program_
.
scope
));
return
std
::
make_shared
<
framework
::
Tensor
>
(
framework
::
Tensor
(
*
output_tensor
));
...
...
src/operators/feed_op.h
浏览文件 @
ca32dc7f
...
...
@@ -50,8 +50,8 @@ class FeedOp : public framework::OperatorBase<DeviceType> {
void
RunImpl
()
const
{
auto
input
=
(
Tensor
*
)
const_cast
<
LoDTensor
*>
(
param_
.
InputX
());
auto
input_ptr
=
input
->
data
<
float
>
();
fpga
::
format_image
(
input
);
auto
input_ptr
=
input
->
data
<
float
>
();
Tensor
*
output
=
param_
.
Out
();
auto
output_ptr
=
output
->
data
<
float
>
();
...
...
src/operators/kernel/fpga/concat_kernel.cpp
浏览文件 @
ca32dc7f
...
...
@@ -47,7 +47,7 @@ bool ConcatKernel<FPGA, float>::Init(ConcatParam<FPGA> *param) {
concatArgs
.
image_num
=
(
uint32_t
)
image_num
;
concatArgs
.
images_in
=
images_in
;
concatArgs
.
scales_in
=
scales_in
;
concatArgs
.
image_out
=
(
half
*
)
out
->
mutable_
data
<
float
>
();
concatArgs
.
image_out
=
(
half
*
)
out
->
data
<
float
>
();
concatArgs
.
scale_out
=
out
->
scale
;
concatArgs
.
channel_num
=
channel_num
;
concatArgs
.
height
=
(
uint32_t
)
height
;
...
...
src/operators/kernel/fpga/softmax_kernel.cpp
浏览文件 @
ca32dc7f
...
...
@@ -39,8 +39,8 @@ bool SoftmaxKernel<FPGA, float>::Init(SoftmaxParam<FPGA> *param) {
args
.
image
.
height
=
1
;
args
.
image
.
width
=
1
;
args
.
image
.
channels
=
(
uint32_t
)
input
->
dims
()[
1
];
args
.
output
.
address
=
float_input
->
mutable_
data
<
float
>
();
args
.
output
.
address
=
float_input
->
data
<
float
>
();
args
.
output
.
scale_address
=
float_input
->
scale
;
param
->
SetFloatInput
(
float_input
);
param
->
SetFpgaArgs
(
args
);
return
true
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录