Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle-Lite
提交
03b31c6c
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看板
提交
03b31c6c
编写于
5月 31, 2018
作者:
L
liuruilong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
format files
上级
03954e0c
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
18 addition
and
21 deletion
+18
-21
src/common/types.h
src/common/types.h
+2
-1
src/framework/program/program-optimize/node.cpp
src/framework/program/program-optimize/node.cpp
+3
-3
src/framework/program/program-optimize/node.h
src/framework/program/program-optimize/node.h
+4
-4
src/framework/program/program-optimize/program_optimize.cpp
src/framework/program/program-optimize/program_optimize.cpp
+4
-6
src/framework/program/program-optimize/program_optimize.h
src/framework/program/program-optimize/program_optimize.h
+2
-3
src/io.cpp
src/io.cpp
+0
-1
src/operators/fusion_conv_add_relu_op.h
src/operators/fusion_conv_add_relu_op.h
+1
-1
src/operators/fusion_fc_op.h
src/operators/fusion_fc_op.h
+2
-2
未找到文件。
src/common/types.h
浏览文件 @
03b31c6c
...
...
@@ -77,7 +77,8 @@ static const std::string G_OP_TYPE_BATCHNORM = "batch_norm";
static
const
std
::
string
G_OP_TYPE_BOX_CODER
=
"box_coder"
;
static
const
std
::
string
G_OP_TYPE_CONCAT
=
"concat"
;
static
const
std
::
string
G_OP_TYPE_ELEMENTWISE_ADD
=
"elementwise_add"
;
static
const
std
::
string
G_OP_TYPE_FUSION_CONV_ADD_RELU
=
"fusion_conv_add_relu"
;
static
const
std
::
string
G_OP_TYPE_FUSION_CONV_ADD_RELU
=
"fusion_conv_add_relu"
;
static
const
std
::
string
G_OP_TYPE_FC
=
"fc"
;
static
const
std
::
string
G_OP_TYPE_LRN
=
"lrn"
;
static
const
std
::
string
G_OP_TYPE_MUL
=
"mul"
;
...
...
src/framework/program/program-optimize/node.cpp
浏览文件 @
03b31c6c
...
...
@@ -51,9 +51,9 @@ bool Node::CanSplit(std::unordered_set<std::string> complex_compute_set) {
return
split
;
}
void
Node
::
CanSplit
(
bool
*
split
,
bool
spliting
,
int
complex_coun
t
,
std
::
unordered_set
<
std
::
string
>
*
complex_compute_set
,
Node
*
pre_node
)
{
void
Node
::
CanSplit
(
bool
*
split
,
bool
spliting
,
int
complex_count
,
std
::
unordered_set
<
std
::
string
>
*
complex_compute_se
t
,
Node
*
pre_node
)
{
if
(
spliting
)
{
if
(
complex_compute_set
->
find
(
this
->
type_
)
!=
complex_compute_set
->
end
())
{
complex_count
++
;
...
...
src/framework/program/program-optimize/node.h
浏览文件 @
03b31c6c
...
...
@@ -16,9 +16,9 @@ limitations under the License. */
#include <map>
#include <string>
#include <unordered_set>
#include <utility>
#include <vector>
#include <unordered_set>
#include "common/log.h"
#include "framework/paddle_mobile_object.h"
...
...
@@ -51,9 +51,9 @@ class Node : PaddleMobileObject {
void
Description
();
private:
void
CanSplit
(
bool
*
split
,
bool
spliting
,
int
complex_coun
t
,
std
::
unordered_set
<
std
::
string
>
*
complex_compute_set
,
Node
*
pre_node
);
void
CanSplit
(
bool
*
split
,
bool
spliting
,
int
complex_count
,
std
::
unordered_set
<
std
::
string
>
*
complex_compute_se
t
,
Node
*
pre_node
);
void
OpDescs
(
std
::
vector
<
std
::
shared_ptr
<
framework
::
OpDesc
>>
*
op_desc
,
Node
*
node
,
bool
adding_thread
,
int
thread_num
);
void
OpDescs
(
uint
size
,
...
...
src/framework/program/program-optimize/program_optimize.cpp
浏览文件 @
03b31c6c
...
...
@@ -99,7 +99,8 @@ std::shared_ptr<ProgramDesc> ProgramOptimize::FushionOptimize(
// DLOG << "node: \n" << *begin_node;
std
::
vector
<
std
::
shared_ptr
<
framework
::
OpDesc
>>
op_descs
;
// bool can_splite = begin_node->CanSplit({G_OP_TYPE_CONV, G_OP_TYPE_BATCHNORM, G_OP_TYPE_DEPTHWISE_CONV});
// bool can_splite = begin_node->CanSplit({G_OP_TYPE_CONV,
// G_OP_TYPE_BATCHNORM, G_OP_TYPE_DEPTHWISE_CONV});
GenerateOps
(
&
op_descs
,
begin_node
.
get
());
block
->
ops_
=
op_descs
;
}
...
...
@@ -112,11 +113,9 @@ std::shared_ptr<ProgramDesc> ProgramOptimize::FushionOptimize(
return
optimize_program
;
}
void
ProgramOptimize
::
GenerateOps
(
std
::
vector
<
std
::
shared_ptr
<
framework
::
OpDesc
>>
*
op_desc
,
Node
*
input_node
,
Node
*
current_node
)
{
std
::
vector
<
std
::
shared_ptr
<
framework
::
OpDesc
>>
*
op_desc
,
Node
*
input_node
,
Node
*
current_node
)
{
if
(
current_node
->
inputs_
.
size
()
>
1
&&
input_node
!=
current_node
->
inputs_
.
back
())
{
return
;
...
...
@@ -131,7 +130,6 @@ void ProgramOptimize::GenerateOps(
auto
&
output
=
current_node
->
outputs_
[
i
];
GenerateOps
(
op_desc
,
current_node
,
output
.
get
());
}
}
void
ProgramOptimize
::
GenerateOps
(
...
...
src/framework/program/program-optimize/program_optimize.h
浏览文件 @
03b31c6c
...
...
@@ -35,9 +35,8 @@ class ProgramOptimize {
std
::
vector
<
std
::
shared_ptr
<
BlockDesc
>>
new_blocks_
;
void
GenerateOps
(
std
::
vector
<
std
::
shared_ptr
<
framework
::
OpDesc
>>
*
op_descs
,
Node
*
begin_node
);
void
GenerateOps
(
std
::
vector
<
std
::
shared_ptr
<
framework
::
OpDesc
>>
*
op_desc
,
Node
*
input_node
,
Node
*
current_node
);
void
GenerateOps
(
std
::
vector
<
std
::
shared_ptr
<
framework
::
OpDesc
>>
*
op_desc
,
Node
*
input_node
,
Node
*
current_node
);
void
GenerateOps
(
std
::
vector
<
std
::
shared_ptr
<
framework
::
OpDesc
>>
*
op_desc
,
Node
*
input_node
,
Node
*
current_node
,
bool
adding_thread
,
int
thread_num
,
std
::
shared_ptr
<
BlockDesc
>
new_block
);
...
...
src/io.cpp
浏览文件 @
03b31c6c
...
...
@@ -232,7 +232,6 @@ const framework::Program<Dtype, P> Loader<Dtype, P>::Load(
originProgramDesc
->
Description
(
"program: "
);
}
paddle_mobile__framework__proto__program_desc__free_unpacked
(
c_program
,
NULL
);
return
program
;
}
...
...
src/operators/fusion_conv_add_relu_op.h
浏览文件 @
03b31c6c
...
...
@@ -32,7 +32,7 @@ class FushionConvAddReluOpMatcher : public framework::FusionOpMatcher {
std
::
vector
<
std
::
shared_ptr
<
framework
::
OpDesc
>>
origin_descs
=
node
->
OpDescs
(
node_
.
Depth
());
node
->
Folder
(
node_
.
Depth
(),
Type
(),
{{
G_OP_TYPE_ELEMENTWISE_ADD
,
{
"Y"
,
"Z"
}}});
{{
G_OP_TYPE_ELEMENTWISE_ADD
,
{
"Y"
,
"Z"
}}});
}
std
::
string
Type
()
{
return
G_OP_TYPE_FUSION_CONV_ADD_RELU
;
}
};
...
...
src/operators/fusion_fc_op.h
浏览文件 @
03b31c6c
...
...
@@ -32,11 +32,11 @@ class FusionFcMatcher : public framework::FusionOpMatcher {
node_
>
std
::
make_shared
<
framework
::
Node
>
(
G_OP_TYPE_ELEMENTWISE_ADD
);
}
void
FolderNodes
(
framework
::
Node
*
node
)
{
void
FolderNodes
(
framework
::
Node
*
node
)
{
vector
<
std
::
shared_ptr
<
framework
::
OpDesc
>>
origin_descs
=
node
->
OpDescs
(
node_
.
Depth
());
node
->
Folder
(
node_
.
Depth
(),
Type
(),
{{
G_OP_TYPE_ELEMENTWISE_ADD
,
{
"Y"
,
"Z"
}}});
{{
G_OP_TYPE_ELEMENTWISE_ADD
,
{
"Y"
,
"Z"
}}});
}
std
::
string
Type
()
{
return
G_OP_TYPE_FC
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录