Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle-Lite
提交
d0de3eac
P
Paddle-Lite
项目概览
PaddlePaddle
/
Paddle-Lite
通知
332
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看板
提交
d0de3eac
编写于
11月 19, 2018
作者:
qnqinan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update FPGA support op and related files
上级
202d5f29
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
36 addition
and
31 deletion
+36
-31
src/operators/fusion_conv_add_relu_op.h
src/operators/fusion_conv_add_relu_op.h
+1
-1
src/operators/fusion_deconv_add_op.h
src/operators/fusion_deconv_add_op.h
+8
-8
src/operators/fusion_deconv_add_relu_op.cpp
src/operators/fusion_deconv_add_relu_op.cpp
+2
-1
src/operators/fusion_deconv_add_relu_op.h
src/operators/fusion_deconv_add_relu_op.h
+12
-11
src/operators/kernel/fpga/V2/deconv_add_relu_kernel.cpp
src/operators/kernel/fpga/V2/deconv_add_relu_kernel.cpp
+2
-1
src/operators/kernel/fpga/V2/transpose2_kernel.cpp
src/operators/kernel/fpga/V2/transpose2_kernel.cpp
+3
-2
src/operators/op_param.h
src/operators/op_param.h
+7
-6
src/operators/split_op.cpp
src/operators/split_op.cpp
+1
-1
未找到文件。
src/operators/fusion_conv_add_relu_op.h
浏览文件 @
d0de3eac
...
...
@@ -31,7 +31,7 @@ class FusionConvAddReluOpMatcher : public framework::FusionOpMatcher {
FusionConvAddReluOpMatcher
()
{
node_
=
framework
::
Node
(
G_OP_TYPE_CONV
);
node_
>
std
::
make_shared
<
framework
::
Node
>
(
G_OP_TYPE_ELEMENTWISE_ADD
)
>
std
::
make_shared
<
framework
::
Node
>
(
G_OP_TYPE_RELU
);
std
::
make_shared
<
framework
::
Node
>
(
G_OP_TYPE_RELU
);
}
void
FolderNodes
(
...
...
src/operators/fusion_deconv_add_op.h
浏览文件 @
d0de3eac
...
...
@@ -34,8 +34,8 @@ class FusionDeconvAddMatcher : public framework::FusionOpMatcher {
void
FolderNodes
(
framework
::
Node
*
node
,
std
::
vector
<
std
::
shared_ptr
<
framework
::
Node
>>
*
removed_nodes
)
{
node
->
Folder
(
node_
.
Depth
(),
Type
(),
{{
G_OP_TYPE_ELEMENTWISE_ADD
,
{{
"Y"
,
"Y"
}}}},
removed_nodes
);
node
->
Folder
(
node_
.
Depth
(),
Type
(),
{{
G_OP_TYPE_ELEMENTWISE_ADD
,
{{
"Y"
,
"Y"
}}}},
removed_nodes
);
}
std
::
string
Type
()
{
return
G_OP_TYPE_FUSION_DECONV_ADD
;
}
...
...
@@ -43,17 +43,17 @@ class FusionDeconvAddMatcher : public framework::FusionOpMatcher {
template
<
typename
DeviceType
,
typename
T
>
class
FusionDeconvAddOp
:
public
framework
::
OperatorWithKernel
<
DeviceType
,
FusionDeconvAddParam
<
DeviceType
>
,
operators
::
DeconvAddKernel
<
DeviceType
,
T
>>
{
DeviceType
,
FusionDeconvAddParam
<
DeviceType
>
,
operators
::
DeconvAddKernel
<
DeviceType
,
T
>>
{
public:
FusionDeconvAddOp
(
const
string
&
type
,
const
VariableNameMap
&
inputs
,
const
VariableNameMap
&
outputs
,
const
framework
::
AttributeMap
&
attrs
,
std
::
shared_ptr
<
framework
::
Scope
>
scope
)
const
VariableNameMap
&
outputs
,
const
framework
::
AttributeMap
&
attrs
,
std
::
shared_ptr
<
framework
::
Scope
>
scope
)
:
framework
::
OperatorWithKernel
<
DeviceType
,
FusionDeconvAddParam
<
DeviceType
>
,
operators
::
DeconvAddKernel
<
DeviceType
,
T
>>
(
type
,
inputs
,
outputs
,
attrs
,
scope
)
{}
attrs
,
scope
)
{}
void
InferShape
()
const
{
auto
input
=
this
->
param_
.
Input
();
...
...
src/operators/fusion_deconv_add_relu_op.cpp
浏览文件 @
d0de3eac
...
...
@@ -21,7 +21,8 @@ namespace operators {}
}
// namespace paddle_mobile
namespace
ops
=
paddle_mobile
::
operators
;
REGISTER_FUSION_MATCHER
(
fusion_deconv_add_relu
,
ops
::
FusionDeconvAddReluMatcher
);
REGISTER_FUSION_MATCHER
(
fusion_deconv_add_relu
,
ops
::
FusionDeconvAddReluMatcher
);
#ifdef PADDLE_MOBILE_CPU
#endif
#ifdef PADDLE_MOBILE_MALI_GPU
...
...
src/operators/fusion_deconv_add_relu_op.h
浏览文件 @
d0de3eac
...
...
@@ -29,32 +29,33 @@ class FusionDeconvAddReluMatcher : public framework::FusionOpMatcher {
FusionDeconvAddReluMatcher
()
{
node_
=
framework
::
Node
(
G_OP_TYPE_CONV_TRANSPOSE
);
node_
>
std
::
make_shared
<
framework
::
Node
>
(
G_OP_TYPE_ELEMENTWISE_ADD
)
>
std
::
make_shared
<
framework
::
Node
>
(
G_OP_TYPE_RELU
);
std
::
make_shared
<
framework
::
Node
>
(
G_OP_TYPE_RELU
);
}
void
FolderNodes
(
framework
::
Node
*
node
,
std
::
vector
<
std
::
shared_ptr
<
framework
::
Node
>>
*
removed_nodes
)
{
node
->
Folder
(
node_
.
Depth
(),
Type
(),
{{
G_OP_TYPE_ELEMENTWISE_ADD
,
{{
"Y"
,
"Y"
}}}},
removed_nodes
);
node
->
Folder
(
node_
.
Depth
(),
Type
(),
{{
G_OP_TYPE_ELEMENTWISE_ADD
,
{{
"Y"
,
"Y"
}}}},
removed_nodes
);
}
std
::
string
Type
()
{
return
G_OP_TYPE_FUSION_DECONV_ADD_RELU
;
}
};
template
<
typename
DeviceType
,
typename
T
>
class
FusionDeconvAddReluOp
:
public
framework
::
OperatorWithKernel
<
DeviceType
,
FusionDeconvAddReluParam
<
DeviceType
>
,
operators
::
DeconvAddReluKernel
<
DeviceType
,
T
>>
{
class
FusionDeconvAddReluOp
:
public
framework
::
OperatorWithKernel
<
DeviceType
,
FusionDeconvAddReluParam
<
DeviceType
>
,
operators
::
DeconvAddReluKernel
<
DeviceType
,
T
>>
{
public:
FusionDeconvAddReluOp
(
const
string
&
type
,
const
VariableNameMap
&
inputs
,
const
VariableNameMap
&
outputs
,
const
framework
::
AttributeMap
&
attrs
,
std
::
shared_ptr
<
framework
::
Scope
>
scope
)
const
VariableNameMap
&
outputs
,
const
framework
::
AttributeMap
&
attrs
,
std
::
shared_ptr
<
framework
::
Scope
>
scope
)
:
framework
::
OperatorWithKernel
<
DeviceType
,
FusionDeconvAddReluParam
<
DeviceType
>
,
operators
::
DeconvAddReluKernel
<
DeviceType
,
T
>>
(
type
,
inputs
,
outputs
,
attrs
,
scope
)
{}
operators
::
DeconvAddReluKernel
<
DeviceType
,
T
>>
(
type
,
inputs
,
outputs
,
attrs
,
scope
)
{}
void
InferShape
()
const
{
auto
input
=
this
->
param_
.
Input
();
...
...
src/operators/kernel/fpga/V2/deconv_add_relu_kernel.cpp
浏览文件 @
d0de3eac
...
...
@@ -22,7 +22,8 @@ namespace paddle_mobile {
namespace
operators
{
template
<
>
bool
DeconvAddReluKernel
<
FPGA
,
float
>::
Init
(
FusionDeconvAddReluParam
<
FPGA
>
*
param
)
{
bool
DeconvAddReluKernel
<
FPGA
,
float
>::
Init
(
FusionDeconvAddReluParam
<
FPGA
>
*
param
)
{
return
true
;
}
...
...
src/operators/kernel/fpga/V2/transpose2_kernel.cpp
浏览文件 @
d0de3eac
...
...
@@ -25,8 +25,9 @@ bool Transpose2Kernel<FPGA, float>::Init(Transpose2Param<FPGA> *param) {
}
template
<
>
void
Transpose2Kernel
<
FPGA
,
float
>::
Compute
(
const
Transpose2Param
<
FPGA
>
&
param
)
{
//Transpose2Compute<float>(param);
void
Transpose2Kernel
<
FPGA
,
float
>::
Compute
(
const
Transpose2Param
<
FPGA
>
&
param
)
{
// Transpose2Compute<float>(param);
}
}
// namespace operators
...
...
src/operators/op_param.h
浏览文件 @
d0de3eac
...
...
@@ -2221,9 +2221,9 @@ class ConvTransposeParam : public OpParam {
const
Scope
&
scope
)
{
filter_
=
FilterFrom
<
GType
>
(
inputs
,
scope
);
input_
=
InputFrom
<
GType
>
(
inputs
,
scope
);
//output_ = OutputFrom<GType>(outputs, scope);
//
output_ = OutputFrom<GType>(outputs, scope);
if
(
outputs
.
count
(
"Output"
))
{
output_
=
OpParam
::
OutputFrom
<
GType
>
(
outputs
,
scope
);
output_
=
OpParam
::
OutputFrom
<
GType
>
(
outputs
,
scope
);
}
strides_
=
GetAttr
<
vector
<
int
>>
(
"strides"
,
attrs
);
paddings_
=
GetAttr
<
vector
<
int
>>
(
"paddings"
,
attrs
);
...
...
@@ -2270,11 +2270,12 @@ template <typename Dtype>
class
FusionDeconvAddParam
:
public
ConvTransposeParam
<
Dtype
>
{
typedef
typename
DtypeTensorTrait
<
Dtype
>::
gtype
GType
;
typedef
typename
DtypeTensorTrait
<
Dtype
>::
rtype
RType
;
public:
public:
FusionDeconvAddParam
(
const
VariableNameMap
&
inputs
,
const
VariableNameMap
&
outputs
,
const
AttributeMap
&
attr
s
,
const
Scope
&
scope
)
:
ConvTransposeParam
<
Dtype
>
(
inputs
,
outputs
,
attrs
,
scope
)
{
const
VariableNameMap
&
output
s
,
const
AttributeMap
&
attrs
,
const
Scope
&
scope
)
:
ConvTransposeParam
<
Dtype
>
(
inputs
,
outputs
,
attrs
,
scope
)
{
bias_
=
OpParam
::
InputYFrom
<
GType
>
(
inputs
,
scope
);
axis_
=
OpParam
::
GetAttr
<
int
>
(
"axis"
,
attrs
);
output_
=
OpParam
::
OutFrom
<
GType
>
(
outputs
,
scope
);
...
...
src/operators/split_op.cpp
浏览文件 @
d0de3eac
...
...
@@ -13,8 +13,8 @@ See the License for the specific language governing permissions and
limitations under the License. */
#ifdef SPLIT_OP
#include <vector>
#include "operators/split_op.h"
#include <vector>
namespace
paddle_mobile
{
namespace
operators
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录