Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle-Lite
提交
4741e8fc
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看板
提交
4741e8fc
编写于
8月 16, 2018
作者:
Z
zhangyang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
correct feed_op for FPGA
上级
1559e7fd
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
4 addition
and
19 deletion
+4
-19
src/operators/feed_op.h
src/operators/feed_op.h
+4
-5
src/operators/op_param.h
src/operators/op_param.h
+0
-14
未找到文件。
src/operators/feed_op.h
浏览文件 @
4741e8fc
...
@@ -36,12 +36,12 @@ class FeedOp : public framework::OperatorBase<DeviceType> {
...
@@ -36,12 +36,12 @@ class FeedOp : public framework::OperatorBase<DeviceType> {
out_dims
[
0
]
=
param_
.
BatchSize
();
out_dims
[
0
]
=
param_
.
BatchSize
();
param_
.
Out
()
->
Resize
(
out_dims
);
param_
.
Out
()
->
Resize
(
out_dims
);
}
}
void
Init
()
{}
#ifdef PADDLE_MOBILE_FPGA
#ifdef PADDLE_MOBILE_FPGA
void
RunImpl
()
const
{
fpga
::
PerformBypass
(
param_
.
FpgaArgs
());
}
void
RunImpl
()
const
{
void
Init
()
{
const
Tensor
*
input
=
param_
.
InputX
();
const
Tensor
*
input
=
param_
.
InputX
();
auto
input_ptr
=
(
const_cast
<
Tensor
*>
(
input
))
->
mutable_
data
<
float
>
();
auto
input_ptr
=
input
->
data
<
float
>
();
Tensor
*
output
=
param_
.
Out
();
Tensor
*
output
=
param_
.
Out
();
auto
output_ptr
=
output
->
mutable_data
<
half
>
();
auto
output_ptr
=
output
->
mutable_data
<
half
>
();
fpga
::
BypassArgs
args
;
fpga
::
BypassArgs
args
;
...
@@ -52,12 +52,11 @@ class FeedOp : public framework::OperatorBase<DeviceType> {
...
@@ -52,12 +52,11 @@ class FeedOp : public framework::OperatorBase<DeviceType> {
args
.
image
.
height
=
input
->
dims
()[
2
];
args
.
image
.
height
=
input
->
dims
()[
2
];
args
.
image
.
width
=
input
->
dims
()[
3
];
args
.
image
.
width
=
input
->
dims
()[
3
];
args
.
output
.
address
=
output_ptr
;
args
.
output
.
address
=
output_ptr
;
param_
.
SetFpgaArg
s
(
args
);
fpga
::
PerformBypas
s
(
args
);
}
}
#else
#else
void
RunImpl
()
const
{
param_
.
Out
()
->
ShareDataWith
(
*
param_
.
InputX
());
}
void
RunImpl
()
const
{
param_
.
Out
()
->
ShareDataWith
(
*
param_
.
InputX
());
}
void
Init
()
{}
#endif
#endif
protected:
protected:
...
...
src/operators/op_param.h
浏览文件 @
4741e8fc
...
@@ -665,16 +665,6 @@ class FeedParam : public OpParam {
...
@@ -665,16 +665,6 @@ class FeedParam : public OpParam {
Tensor
*
input_x_
;
Tensor
*
input_x_
;
Tensor
*
out_
;
Tensor
*
out_
;
int
batch_size
;
int
batch_size
;
#ifdef PADDLE_MOBILE_FPGA
private:
fpga
::
BypassArgs
fpga_bypass_args
;
public:
const
fpga
::
BypassArgs
&
FpgaArgs
()
const
{
return
fpga_bypass_args
;
}
void
SetFpgaArgs
(
const
fpga
::
BypassArgs
&
args
)
{
fpga_bypass_args
=
args
;
}
#endif
};
};
class
FetchParam
:
public
OpParam
{
class
FetchParam
:
public
OpParam
{
...
@@ -1133,7 +1123,6 @@ class FusionConvBNParam : public OpParam {
...
@@ -1133,7 +1123,6 @@ class FusionConvBNParam : public OpParam {
FusionConvBNParam
(
const
VariableNameMap
&
inputs
,
FusionConvBNParam
(
const
VariableNameMap
&
inputs
,
const
VariableNameMap
&
outputs
,
const
AttributeMap
&
attrs
,
const
VariableNameMap
&
outputs
,
const
AttributeMap
&
attrs
,
const
Scope
&
scope
)
{
const
Scope
&
scope
)
{
axis_
=
GetAttr
<
int
>
(
"axis"
,
attrs
);
filter_
=
FilterFrom
<
LoDTensor
>
(
inputs
,
scope
);
filter_
=
FilterFrom
<
LoDTensor
>
(
inputs
,
scope
);
input_
=
InputFrom
<
LoDTensor
>
(
inputs
,
scope
);
input_
=
InputFrom
<
LoDTensor
>
(
inputs
,
scope
);
output_y_
=
OutputYFrom
<
LoDTensor
>
(
outputs
,
scope
);
output_y_
=
OutputYFrom
<
LoDTensor
>
(
outputs
,
scope
);
...
@@ -1150,8 +1139,6 @@ class FusionConvBNParam : public OpParam {
...
@@ -1150,8 +1139,6 @@ class FusionConvBNParam : public OpParam {
// is_test_ = GetAttr<bool>("is_test", attrs);
// is_test_ = GetAttr<bool>("is_test", attrs);
}
}
const
int
&
Axis
()
const
{
return
axis_
;
}
const
Tensor
*
Input
()
const
{
return
input_
;
}
const
Tensor
*
Input
()
const
{
return
input_
;
}
#ifdef PADDLE_MOBILE_FPGA
#ifdef PADDLE_MOBILE_FPGA
...
@@ -1192,7 +1179,6 @@ class FusionConvBNParam : public OpParam {
...
@@ -1192,7 +1179,6 @@ class FusionConvBNParam : public OpParam {
const
Tensor
*
NewBias
()
const
{
return
new_bias_
;
}
const
Tensor
*
NewBias
()
const
{
return
new_bias_
;
}
protected:
protected:
int
axis_
;
Tensor
*
input_
;
Tensor
*
input_
;
Tensor
*
output_y_
;
Tensor
*
output_y_
;
Tensor
*
filter_
;
Tensor
*
filter_
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录