Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle-Lite
提交
645b1b3b
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看板
提交
645b1b3b
编写于
6月 15, 2018
作者:
L
liuruilong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
format files
上级
b11b2db2
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
11 addition
and
12 deletion
+11
-12
src/common/types.cpp
src/common/types.cpp
+6
-8
src/framework/operator.h
src/framework/operator.h
+2
-1
src/operators/relu_op.h
src/operators/relu_op.h
+1
-1
test/net/test_googlenet.cpp
test/net/test_googlenet.cpp
+2
-2
未找到文件。
src/common/types.cpp
浏览文件 @
645b1b3b
...
...
@@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. */
#include <vector>
#include "common/types.h"
#include <vector>
namespace
paddle_mobile
{
...
...
@@ -22,8 +22,7 @@ const std::string G_OP_TYPE_BATCHNORM = "batch_norm";
const
std
::
string
G_OP_TYPE_BOX_CODER
=
"box_coder"
;
const
std
::
string
G_OP_TYPE_CONCAT
=
"concat"
;
const
std
::
string
G_OP_TYPE_ELEMENTWISE_ADD
=
"elementwise_add"
;
const
std
::
string
G_OP_TYPE_FUSION_CONV_ADD_RELU
=
"fusion_conv_add_relu"
;
const
std
::
string
G_OP_TYPE_FUSION_CONV_ADD_RELU
=
"fusion_conv_add_relu"
;
const
std
::
string
G_OP_TYPE_FC
=
"fc"
;
const
std
::
string
G_OP_TYPE_CONV_ADD
=
"conv_add"
;
const
std
::
string
G_OP_TYPE_LRN
=
"lrn"
;
...
...
@@ -41,10 +40,9 @@ const std::string G_OP_TYPE_FEED = "feed";
const
std
::
string
G_OP_TYPE_FETCH
=
"fetch"
;
const
std
::
string
G_OP_TYPE_DEPTHWISE_CONV
=
"depthwise_conv2d"
;
std
::
unordered_map
<
std
::
string
,
std
::
pair
<
std
::
vector
<
std
::
string
>
,
std
::
vector
<
std
::
string
>>>
op_input_output_key
=
{
std
::
string
,
std
::
pair
<
std
::
vector
<
std
::
string
>
,
std
::
vector
<
std
::
string
>>>
op_input_output_key
=
{
{
G_OP_TYPE_CONV
,
{{
"Input"
},
{
"Output"
}}},
{
G_OP_TYPE_CONV_ADD
,
{{
"Input"
},
{
"Out"
}}},
{
G_OP_TYPE_RELU
,
{{
"X"
},
{
"Out"
}}},
...
...
@@ -60,11 +58,11 @@ std::unordered_map<
{
G_OP_TYPE_FETCH
,
{{
"X"
},
{
"Out"
}}},
{
G_OP_TYPE_TRANSPOSE
,
{{
"X"
},
{
"Out"
}}},
{
G_OP_TYPE_BOX_CODER
,
{{
"PriorBox"
,
"PriorBoxVar"
,
"TargetBox"
},
{
"OutputBox"
}}},
{{
"PriorBox"
,
"PriorBoxVar"
,
"TargetBox"
},
{
"OutputBox"
}}},
{
G_OP_TYPE_PRIOR_BOX
,
{{
"Image"
,
"Input"
},
{
"Boxes"
,
"Variances"
}}},
{
G_OP_TYPE_MULTICLASS_NMS
,
{{
"BBoxes"
,
"Scores"
},
{
"Out"
}}},
{
G_OP_TYPE_FC
,
{{
"X"
,
"Y"
,
"Z"
},
{
"Out"
}}},
{
G_OP_TYPE_RESHAPE
,
{{
"X"
},
{
"Out"
}}},
{
G_OP_TYPE_DEPTHWISE_CONV
,
{{
"Input"
},
{
"Output"
}}}};
}
}
// namespace paddle_mobile
src/framework/operator.h
浏览文件 @
645b1b3b
...
...
@@ -111,7 +111,8 @@ class OperatorWithKernel : public OperatorBase<Dtype> {
std
::
shared_ptr
<
Scope
>
scope
)
:
OperatorBase
<
Dtype
>
(
type
,
inputs
,
outputs
,
attrs
,
scope
),
param_
(
inputs
,
outputs
,
attrs
,
*
scope
)
{
PADDLE_MOBILE_ENFORCE
(
kernel_
.
Init
(
param_
),
" %s kernel init failed"
,
this
->
type_
.
c_str
());
PADDLE_MOBILE_ENFORCE
(
kernel_
.
Init
(
param_
),
" %s kernel init failed"
,
this
->
type_
.
c_str
());
}
virtual
void
RunImpl
()
const
{
this
->
kernel_
.
Compute
(
this
->
param_
);
}
...
...
src/operators/relu_op.h
浏览文件 @
645b1b3b
...
...
@@ -19,8 +19,8 @@ limitations under the License. */
#include <string>
#include "framework/operator.h"
#include "operators/op_param.h"
#include "operators/kernel/relu_kernel.h"
#include "operators/op_param.h"
namespace
paddle_mobile
{
namespace
operators
{
...
...
test/net/test_googlenet.cpp
浏览文件 @
645b1b3b
...
...
@@ -20,9 +20,9 @@ int main() {
paddle_mobile
::
Loader
<
paddle_mobile
::
CPU
>
loader
;
bool
optimize
=
true
;
auto
time1
=
time
();
// auto program = loader.Load(g_googlenet, optimize);
// auto program = loader.Load(g_googlenet, optimize);
auto
program
=
loader
.
Load
(
g_googlenet_combine
+
"/model"
,
g_googlenet_combine
+
"/params"
,
optimize
);
g_googlenet_combine
+
"/params"
,
optimize
);
auto
time2
=
time
();
DLOG
<<
"load cost :"
<<
time_diff
(
time1
,
time2
)
<<
"ms
\n
"
;
paddle_mobile
::
Executor
<
paddle_mobile
::
CPU
>
executor
(
program
,
1
,
optimize
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录