Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle-Lite
提交
682b400f
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看板
未验证
提交
682b400f
编写于
7月 18, 2018
作者:
R
Ruilong Liu
提交者:
GitHub
7月 18, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'develop' into develop
上级
b525acfd
4f5700d6
变更
38
显示空白变更内容
内联
并排
Showing
38 changed file
with
38 addition
and
71 deletion
+38
-71
CMakeLists.txt
CMakeLists.txt
+1
-1
src/common/variant.h
src/common/variant.h
+1
-1
src/framework/program/program-optimize/fusion_op_register.h
src/framework/program/program-optimize/fusion_op_register.h
+11
-2
src/framework/program/program-optimize/node.cpp
src/framework/program/program-optimize/node.cpp
+0
-17
src/framework/program/program-optimize/node.h
src/framework/program/program-optimize/node.h
+0
-3
src/framework/program/program-optimize/program_optimize.cpp
src/framework/program/program-optimize/program_optimize.cpp
+2
-3
src/operators/batchnorm_op.cpp
src/operators/batchnorm_op.cpp
+1
-1
src/operators/box_coder_op.cpp
src/operators/box_coder_op.cpp
+1
-1
src/operators/concat_op.cpp
src/operators/concat_op.cpp
+0
-1
src/operators/conv_op.cpp
src/operators/conv_op.cpp
+0
-2
src/operators/depthwise_conv_op.cpp
src/operators/depthwise_conv_op.cpp
+0
-2
src/operators/dropout_op.cpp
src/operators/dropout_op.cpp
+1
-1
src/operators/elementwise_add_op.cpp
src/operators/elementwise_add_op.cpp
+1
-1
src/operators/feed_op.cpp
src/operators/feed_op.cpp
+1
-4
src/operators/fetch_op.cpp
src/operators/fetch_op.cpp
+1
-4
src/operators/fusion_conv_add.cpp
src/operators/fusion_conv_add.cpp
+0
-1
src/operators/fusion_conv_add.h
src/operators/fusion_conv_add.h
+0
-2
src/operators/fusion_conv_add_bn_relu_op.cpp
src/operators/fusion_conv_add_bn_relu_op.cpp
+1
-1
src/operators/fusion_conv_add_bn_relu_op.h
src/operators/fusion_conv_add_bn_relu_op.h
+0
-2
src/operators/fusion_dwconv_bn_relu_op.cpp
src/operators/fusion_dwconv_bn_relu_op.cpp
+1
-1
src/operators/fusion_dwconv_bn_relu_op.h
src/operators/fusion_dwconv_bn_relu_op.h
+0
-2
src/operators/fusion_fc_op.cpp
src/operators/fusion_fc_op.cpp
+0
-1
src/operators/im2sequence_op.cpp
src/operators/im2sequence_op.cpp
+0
-2
src/operators/lrn_op.cpp
src/operators/lrn_op.cpp
+1
-1
src/operators/mul_op.cpp
src/operators/mul_op.cpp
+1
-1
src/operators/multiclass_nms_op.cpp
src/operators/multiclass_nms_op.cpp
+1
-1
src/operators/op_param.h
src/operators/op_param.h
+1
-1
src/operators/pool_op.cpp
src/operators/pool_op.cpp
+1
-1
src/operators/prelu_op.cpp
src/operators/prelu_op.cpp
+1
-1
src/operators/prior_box_op.cpp
src/operators/prior_box_op.cpp
+1
-1
src/operators/relu_op.cpp
src/operators/relu_op.cpp
+1
-1
src/operators/reshape_op.cpp
src/operators/reshape_op.cpp
+1
-1
src/operators/resize_op.cpp
src/operators/resize_op.cpp
+1
-1
src/operators/scale_op.cpp
src/operators/scale_op.cpp
+1
-1
src/operators/sigmoid_op.cpp
src/operators/sigmoid_op.cpp
+1
-1
src/operators/slice_op.cpp
src/operators/slice_op.cpp
+1
-1
src/operators/softmax_op.cpp
src/operators/softmax_op.cpp
+1
-1
src/operators/transpose_op.cpp
src/operators/transpose_op.cpp
+1
-1
未找到文件。
CMakeLists.txt
浏览文件 @
682b400f
cmake_minimum_required
(
VERSION 3.
0
)
cmake_minimum_required
(
VERSION 3.
6
)
project
(
paddle-mobile
)
project
(
paddle-mobile
)
option
(
DEBUGING
"enable debug mode"
ON
)
option
(
DEBUGING
"enable debug mode"
ON
)
...
...
src/common/variant.h
浏览文件 @
682b400f
...
@@ -84,7 +84,7 @@ struct Variant {
...
@@ -84,7 +84,7 @@ struct Variant {
if
(
type_id
==
typeid
(
T
).
hash_code
())
{
if
(
type_id
==
typeid
(
T
).
hash_code
())
{
return
*
const_cast
<
T
*>
(
reinterpret_cast
<
const
T
*>
(
&
data
));
return
*
const_cast
<
T
*>
(
reinterpret_cast
<
const
T
*>
(
&
data
));
}
else
{
}
else
{
PADDLE_MOBILE_THROW_EXCEPTION
(
" bad cast in variant
"
);
PADDLE_MOBILE_THROW_EXCEPTION
(
" bad cast in variant"
);
exit
(
0
);
exit
(
0
);
}
}
}
}
...
...
src/framework/program/program-optimize/fusion_op_register.h
浏览文件 @
682b400f
...
@@ -42,8 +42,17 @@ class FusionOpRegister {
...
@@ -42,8 +42,17 @@ class FusionOpRegister {
matchers_
[
matcher
->
Type
()]
=
shared_matcher
;
matchers_
[
matcher
->
Type
()]
=
shared_matcher
;
}
}
const
std
::
map
<
std
::
string
,
std
::
shared_ptr
<
FusionOpMatcher
>>
Matchers
()
{
const
std
::
vector
<
std
::
shared_ptr
<
FusionOpMatcher
>>
Matchers
()
{
return
matchers_
;
std
::
vector
<
std
::
shared_ptr
<
FusionOpMatcher
>>
matchers
;
for
(
const
auto
&
match
:
matchers_
)
{
matchers
.
push_back
(
match
.
second
);
}
std
::
sort
(
matchers
.
begin
(),
matchers
.
end
(),
[](
std
::
shared_ptr
<
FusionOpMatcher
>
first
,
std
::
shared_ptr
<
FusionOpMatcher
>
second
)
{
return
first
->
BeginNode
().
Depth
()
>
second
->
BeginNode
().
Depth
();
});
return
matchers
;
}
}
private:
private:
...
...
src/framework/program/program-optimize/node.cpp
浏览文件 @
682b400f
...
@@ -44,23 +44,6 @@ bool Node::operator==(const Node &in) {
...
@@ -44,23 +44,6 @@ bool Node::operator==(const Node &in) {
return
true
;
return
true
;
}
}
std
::
vector
<
std
::
shared_ptr
<
framework
::
OpDesc
>>
Node
::
OpDescs
(
int
size
)
{
std
::
vector
<
std
::
shared_ptr
<
framework
::
OpDesc
>>
op_descs
;
OpDescs
(
size
-
1
,
&
op_descs
);
return
op_descs
;
}
void
Node
::
OpDescs
(
int
index
,
std
::
vector
<
std
::
shared_ptr
<
framework
::
OpDesc
>>
*
op_desc
)
{
if
(
index
==
0
)
{
return
;
}
op_desc
->
push_back
(
this
->
op_desc_
);
for
(
auto
&
output
:
outputs_
)
{
output
->
OpDescs
(
index
,
op_desc
);
}
}
std
::
shared_ptr
<
Node
>
Node
::
To
(
int
size
)
{
std
::
shared_ptr
<
Node
>
Node
::
To
(
int
size
)
{
std
::
shared_ptr
<
Node
>
node
=
std
::
make_shared
<
Node
>
();
std
::
shared_ptr
<
Node
>
node
=
std
::
make_shared
<
Node
>
();
this
->
To
(
size
-
1
,
node
);
this
->
To
(
size
-
1
,
node
);
...
...
src/framework/program/program-optimize/node.h
浏览文件 @
682b400f
...
@@ -47,13 +47,10 @@ class Node {
...
@@ -47,13 +47,10 @@ class Node {
std
::
map
<
std
::
string
,
std
::
vector
<
std
::
pair
<
std
::
string
,
std
::
string
>>>
std
::
map
<
std
::
string
,
std
::
vector
<
std
::
pair
<
std
::
string
,
std
::
string
>>>
change
,
change
,
std
::
vector
<
std
::
shared_ptr
<
Node
>>
*
removed_nodes
);
std
::
vector
<
std
::
shared_ptr
<
Node
>>
*
removed_nodes
);
std
::
vector
<
std
::
shared_ptr
<
framework
::
OpDesc
>>
OpDescs
(
int
size
);
std
::
shared_ptr
<
framework
::
OpDesc
>
OpDescOfNode
()
{
return
op_desc_
;
}
std
::
shared_ptr
<
framework
::
OpDesc
>
OpDescOfNode
()
{
return
op_desc_
;
}
std
::
string
Type
()
{
return
type_
;
}
std
::
string
Type
()
{
return
type_
;
}
private:
private:
void
OpDescs
(
int
size
,
std
::
vector
<
std
::
shared_ptr
<
framework
::
OpDesc
>>
*
op_desc
);
void
To
(
int
index
,
std
::
shared_ptr
<
Node
>
);
void
To
(
int
index
,
std
::
shared_ptr
<
Node
>
);
void
Folder
(
void
Folder
(
std
::
shared_ptr
<
framework
::
OpDesc
>
op_desc
,
std
::
shared_ptr
<
framework
::
OpDesc
>
op_desc
,
...
...
src/framework/program/program-optimize/program_optimize.cpp
浏览文件 @
682b400f
...
@@ -78,9 +78,8 @@ std::shared_ptr<ProgramDesc> ProgramOptimize::FusionOptimize(
...
@@ -78,9 +78,8 @@ std::shared_ptr<ProgramDesc> ProgramOptimize::FusionOptimize(
}
}
for
(
auto
&
registed
:
FusionOpRegister
::
Instance
()
->
Matchers
())
{
for
(
auto
&
registed
:
FusionOpRegister
::
Instance
()
->
Matchers
())
{
std
::
string
fusion_type
=
registed
.
first
;
std
::
string
fusion_type
=
registed
->
Type
();
std
::
shared_ptr
<
FusionOpMatcher
>
matcher
=
registed
.
second
;
std
::
shared_ptr
<
FusionOpMatcher
>
matcher
=
registed
;
// DLOG << " registed node \n " << matcher->BeginNode();
auto
match_vector
=
type_map
[
matcher
->
BeginType
()];
auto
match_vector
=
type_map
[
matcher
->
BeginType
()];
...
...
src/operators/batchnorm_op.cpp
浏览文件 @
682b400f
...
@@ -26,7 +26,7 @@ void BatchNormOp<Dtype, T>::InferShape() const {
...
@@ -26,7 +26,7 @@ void BatchNormOp<Dtype, T>::InferShape() const {
auto
x_dims
=
this
->
param_
.
InputX
()
->
dims
();
auto
x_dims
=
this
->
param_
.
InputX
()
->
dims
();
this
->
param_
.
OutputY
()
->
Resize
(
x_dims
);
this
->
param_
.
OutputY
()
->
Resize
(
x_dims
);
}
}
template
class
BatchNormOp
<
CPU
,
float
>;
}
// namespace operators
}
// namespace operators
}
// namespace paddle_mobile
}
// namespace paddle_mobile
...
...
src/operators/box_coder_op.cpp
浏览文件 @
682b400f
...
@@ -47,7 +47,7 @@ void BoxCoderOp<Dtype, T>::InferShape() const {
...
@@ -47,7 +47,7 @@ void BoxCoderOp<Dtype, T>::InferShape() const {
this
->
param_
.
OutputBox
()
->
Resize
(
framework
::
make_ddim
(
this
->
param_
.
OutputBox
()
->
Resize
(
framework
::
make_ddim
(
{
input_targetbox_dims
[
0
],
input_priorbox_dims
[
0
],
4
}));
{
input_targetbox_dims
[
0
],
input_priorbox_dims
[
0
],
4
}));
}
}
template
class
BoxCoderOp
<
CPU
,
float
>;
}
// namespace operators
}
// namespace operators
}
// namespace paddle_mobile
}
// namespace paddle_mobile
...
...
src/operators/concat_op.cpp
浏览文件 @
682b400f
...
@@ -56,7 +56,6 @@ void ConcatOp<Dtype, T>::InferShape() const {
...
@@ -56,7 +56,6 @@ void ConcatOp<Dtype, T>::InferShape() const {
this
->
param_
.
Out
()
->
Resize
(
out_dims
);
this
->
param_
.
Out
()
->
Resize
(
out_dims
);
}
}
template
class
ConcatOp
<
CPU
,
float
>;
}
// namespace operators
}
// namespace operators
}
// namespace paddle_mobile
}
// namespace paddle_mobile
...
...
src/operators/conv_op.cpp
浏览文件 @
682b400f
...
@@ -48,8 +48,6 @@ void ConvOp<Dtype, T>::InferShape() const {
...
@@ -48,8 +48,6 @@ void ConvOp<Dtype, T>::InferShape() const {
this
->
param_
.
Output
()
->
Resize
(
ddim
);
this
->
param_
.
Output
()
->
Resize
(
ddim
);
}
}
template
class
ConvOp
<
CPU
,
float
>;
}
// namespace operators
}
// namespace operators
}
// namespace paddle_mobile
}
// namespace paddle_mobile
...
...
src/operators/depthwise_conv_op.cpp
浏览文件 @
682b400f
...
@@ -49,8 +49,6 @@ void DepthwiseConvOp<Dtype, T>::InferShape() const {
...
@@ -49,8 +49,6 @@ void DepthwiseConvOp<Dtype, T>::InferShape() const {
this
->
param_
.
Output
()
->
Resize
(
ddim
);
this
->
param_
.
Output
()
->
Resize
(
ddim
);
}
}
template
class
DepthwiseConvOp
<
CPU
,
float
>;
}
// namespace operators
}
// namespace operators
}
// namespace paddle_mobile
}
// namespace paddle_mobile
...
...
src/operators/dropout_op.cpp
浏览文件 @
682b400f
...
@@ -22,7 +22,7 @@ void DropoutOp<Dtype, T>::InferShape() const {
...
@@ -22,7 +22,7 @@ void DropoutOp<Dtype, T>::InferShape() const {
auto
input_dims
=
this
->
param_
.
InputX
()
->
dims
();
auto
input_dims
=
this
->
param_
.
InputX
()
->
dims
();
this
->
param_
.
Out
()
->
Resize
(
input_dims
);
this
->
param_
.
Out
()
->
Resize
(
input_dims
);
}
}
template
class
DropoutOp
<
CPU
,
float
>;
}
// namespace operators
}
// namespace operators
}
// namespace paddle_mobile
}
// namespace paddle_mobile
...
...
src/operators/elementwise_add_op.cpp
浏览文件 @
682b400f
...
@@ -24,7 +24,7 @@ void ElementwiseAddOp<Dtype, T>::InferShape() const {
...
@@ -24,7 +24,7 @@ void ElementwiseAddOp<Dtype, T>::InferShape() const {
auto
x_dim
=
this
->
param_
.
InputX
()
->
dims
();
auto
x_dim
=
this
->
param_
.
InputX
()
->
dims
();
this
->
param_
.
Out
()
->
Resize
(
x_dim
);
this
->
param_
.
Out
()
->
Resize
(
x_dim
);
}
}
template
class
ElementwiseAddOp
<
CPU
,
float
>;
}
// namespace operators
}
// namespace operators
}
// namespace paddle_mobile
}
// namespace paddle_mobile
...
...
src/operators/feed_op.cpp
浏览文件 @
682b400f
...
@@ -14,10 +14,7 @@ limitations under the License. */
...
@@ -14,10 +14,7 @@ limitations under the License. */
#include "feed_op.h"
#include "feed_op.h"
namespace
paddle_mobile
{
namespace
paddle_mobile
{
namespace
operators
{
namespace
operators
{}
template
class
FeedOp
<
CPU
,
float
>;
}
}
// namespace paddle_mobile
}
// namespace paddle_mobile
namespace
ops
=
paddle_mobile
::
operators
;
namespace
ops
=
paddle_mobile
::
operators
;
...
...
src/operators/fetch_op.cpp
浏览文件 @
682b400f
...
@@ -14,10 +14,7 @@ limitations under the License. */
...
@@ -14,10 +14,7 @@ limitations under the License. */
#include "fetch_op.h"
#include "fetch_op.h"
namespace
paddle_mobile
{
namespace
paddle_mobile
{
namespace
operators
{
namespace
operators
{}
template
class
FetchOp
<
CPU
,
float
>;
}
}
// namespace paddle_mobile
}
// namespace paddle_mobile
namespace
ops
=
paddle_mobile
::
operators
;
namespace
ops
=
paddle_mobile
::
operators
;
...
...
src/operators/fusion_conv_add.cpp
浏览文件 @
682b400f
...
@@ -45,7 +45,6 @@ void FusionConvAddOp<Dtype, T>::InferShape() const {
...
@@ -45,7 +45,6 @@ void FusionConvAddOp<Dtype, T>::InferShape() const {
this
->
param_
.
Output
()
->
Resize
(
ddim
);
this
->
param_
.
Output
()
->
Resize
(
ddim
);
}
}
template
class
FusionConvAddOp
<
CPU
,
float
>;
}
// namespace operators
}
// namespace operators
}
// namespace paddle_mobile
}
// namespace paddle_mobile
...
...
src/operators/fusion_conv_add.h
浏览文件 @
682b400f
...
@@ -36,8 +36,6 @@ class FusionConvAddMatcher : public framework::FusionOpMatcher {
...
@@ -36,8 +36,6 @@ class FusionConvAddMatcher : public framework::FusionOpMatcher {
void
FolderNodes
(
void
FolderNodes
(
framework
::
Node
*
node
,
framework
::
Node
*
node
,
std
::
vector
<
std
::
shared_ptr
<
framework
::
Node
>>
*
removed_nodes
)
{
std
::
vector
<
std
::
shared_ptr
<
framework
::
Node
>>
*
removed_nodes
)
{
vector
<
std
::
shared_ptr
<
framework
::
OpDesc
>>
origin_descs
=
node
->
OpDescs
(
node_
.
Depth
());
node
->
Folder
(
node_
.
Depth
(),
Type
(),
node
->
Folder
(
node_
.
Depth
(),
Type
(),
{{
G_OP_TYPE_ELEMENTWISE_ADD
,
{{
"Y"
,
"Y"
}}}},
removed_nodes
);
{{
G_OP_TYPE_ELEMENTWISE_ADD
,
{{
"Y"
,
"Y"
}}}},
removed_nodes
);
}
}
...
...
src/operators/fusion_conv_add_bn_relu_op.cpp
浏览文件 @
682b400f
...
@@ -44,7 +44,7 @@ void FusionConvAddBNReluOp<Dtype, T>::InferShape() const {
...
@@ -44,7 +44,7 @@ void FusionConvAddBNReluOp<Dtype, T>::InferShape() const {
framework
::
DDim
ddim
=
framework
::
make_ddim
(
output_shape
);
framework
::
DDim
ddim
=
framework
::
make_ddim
(
output_shape
);
this
->
param_
.
Output
()
->
Resize
(
ddim
);
this
->
param_
.
Output
()
->
Resize
(
ddim
);
}
}
template
class
FusionConvAddBNReluOp
<
CPU
,
float
>;
}
// namespace operators
}
// namespace operators
}
// namespace paddle_mobile
}
// namespace paddle_mobile
...
...
src/operators/fusion_conv_add_bn_relu_op.h
浏览文件 @
682b400f
...
@@ -39,8 +39,6 @@ class FusionConvAddBNReluMatcher : public framework::FusionOpMatcher {
...
@@ -39,8 +39,6 @@ class FusionConvAddBNReluMatcher : public framework::FusionOpMatcher {
void
FolderNodes
(
void
FolderNodes
(
framework
::
Node
*
node
,
framework
::
Node
*
node
,
std
::
vector
<
std
::
shared_ptr
<
framework
::
Node
>>
*
removed_nodes
)
{
std
::
vector
<
std
::
shared_ptr
<
framework
::
Node
>>
*
removed_nodes
)
{
vector
<
std
::
shared_ptr
<
framework
::
OpDesc
>>
origin_descs
=
node
->
OpDescs
(
node_
.
Depth
());
node
->
Folder
(
node_
.
Depth
(),
Type
(),
node
->
Folder
(
node_
.
Depth
(),
Type
(),
{{
G_OP_TYPE_ELEMENTWISE_ADD
,
{{
"Y"
,
"Y"
}}},
{{
G_OP_TYPE_ELEMENTWISE_ADD
,
{{
"Y"
,
"Y"
}}},
{
G_OP_TYPE_BATCHNORM
,
{
G_OP_TYPE_BATCHNORM
,
...
...
src/operators/fusion_dwconv_bn_relu_op.cpp
浏览文件 @
682b400f
...
@@ -44,7 +44,7 @@ void FusionDWConvBNReluOp<Dtype, T>::InferShape() const {
...
@@ -44,7 +44,7 @@ void FusionDWConvBNReluOp<Dtype, T>::InferShape() const {
framework
::
DDim
ddim
=
framework
::
make_ddim
(
output_shape
);
framework
::
DDim
ddim
=
framework
::
make_ddim
(
output_shape
);
this
->
param_
.
Output
()
->
Resize
(
ddim
);
this
->
param_
.
Output
()
->
Resize
(
ddim
);
}
}
template
class
FusionDWConvBNReluOp
<
CPU
,
float
>;
}
// namespace operators
}
// namespace operators
}
// namespace paddle_mobile
}
// namespace paddle_mobile
...
...
src/operators/fusion_dwconv_bn_relu_op.h
浏览文件 @
682b400f
...
@@ -38,8 +38,6 @@ class FusionDWConvBNReluMatcher : public framework::FusionOpMatcher {
...
@@ -38,8 +38,6 @@ class FusionDWConvBNReluMatcher : public framework::FusionOpMatcher {
void
FolderNodes
(
void
FolderNodes
(
framework
::
Node
*
node
,
framework
::
Node
*
node
,
std
::
vector
<
std
::
shared_ptr
<
framework
::
Node
>>
*
removed_nodes
)
{
std
::
vector
<
std
::
shared_ptr
<
framework
::
Node
>>
*
removed_nodes
)
{
vector
<
std
::
shared_ptr
<
framework
::
OpDesc
>>
origin_descs
=
node
->
OpDescs
(
node_
.
Depth
());
node
->
Folder
(
node_
.
Depth
(),
Type
(),
node
->
Folder
(
node_
.
Depth
(),
Type
(),
{{
G_OP_TYPE_BATCHNORM
,
{{
G_OP_TYPE_BATCHNORM
,
{{
"Scale"
,
"Scale"
},
{{
"Scale"
,
"Scale"
},
...
...
src/operators/fusion_fc_op.cpp
浏览文件 @
682b400f
...
@@ -50,7 +50,6 @@ void FusionFcOp<Dtype, T>::InferShape() const {
...
@@ -50,7 +50,6 @@ void FusionFcOp<Dtype, T>::InferShape() const {
this
->
param_
.
Out
()
->
Resize
(
ddim
);
this
->
param_
.
Out
()
->
Resize
(
ddim
);
}
}
template
class
FusionFcOp
<
CPU
,
float
>;
}
// namespace operators
}
// namespace operators
}
// namespace paddle_mobile
}
// namespace paddle_mobile
...
...
src/operators/im2sequence_op.cpp
浏览文件 @
682b400f
...
@@ -47,8 +47,6 @@ void Im2SequenceOp<Dtype, T>::InferShape() const {
...
@@ -47,8 +47,6 @@ void Im2SequenceOp<Dtype, T>::InferShape() const {
this
->
param_
.
Output
()
->
Resize
(
ddim
);
this
->
param_
.
Output
()
->
Resize
(
ddim
);
}
}
template
class
Im2SequenceOp
<
CPU
,
float
>;
}
// namespace operators
}
// namespace operators
}
// namespace paddle_mobile
}
// namespace paddle_mobile
...
...
src/operators/lrn_op.cpp
浏览文件 @
682b400f
...
@@ -24,7 +24,7 @@ void LrnOp<Dtype, T>::InferShape() const {
...
@@ -24,7 +24,7 @@ void LrnOp<Dtype, T>::InferShape() const {
auto
x_dims
=
this
->
param_
.
InputX
()
->
dims
();
auto
x_dims
=
this
->
param_
.
InputX
()
->
dims
();
this
->
param_
.
Out
()
->
Resize
(
x_dims
);
this
->
param_
.
Out
()
->
Resize
(
x_dims
);
}
}
template
class
LrnOp
<
CPU
,
float
>;
}
// namespace operators
}
// namespace operators
}
// namespace paddle_mobile
}
// namespace paddle_mobile
...
...
src/operators/mul_op.cpp
浏览文件 @
682b400f
...
@@ -50,7 +50,7 @@ void MulOp<Dtype, T>::InferShape() const {
...
@@ -50,7 +50,7 @@ void MulOp<Dtype, T>::InferShape() const {
framework
::
DDim
ddim
=
framework
::
make_ddim
(
output_dims
);
framework
::
DDim
ddim
=
framework
::
make_ddim
(
output_dims
);
this
->
param_
.
Out
()
->
Resize
(
ddim
);
this
->
param_
.
Out
()
->
Resize
(
ddim
);
}
}
template
class
MulOp
<
CPU
,
float
>;
}
// namespace operators
}
// namespace operators
}
// namespace paddle_mobile
}
// namespace paddle_mobile
...
...
src/operators/multiclass_nms_op.cpp
浏览文件 @
682b400f
...
@@ -34,7 +34,7 @@ void MultiClassNMSOp<Dtype, T>::InferShape() const {
...
@@ -34,7 +34,7 @@ void MultiClassNMSOp<Dtype, T>::InferShape() const {
// pre size, will change in Compute.
// pre size, will change in Compute.
this
->
param_
.
Out
()
->
Resize
(
framework
::
make_ddim
({
input_bboxes_dims
[
1
],
6
}));
this
->
param_
.
Out
()
->
Resize
(
framework
::
make_ddim
({
input_bboxes_dims
[
1
],
6
}));
}
}
template
class
MultiClassNMSOp
<
CPU
,
float
>;
}
// namespace operators
}
// namespace operators
}
// namespace paddle_mobile
}
// namespace paddle_mobile
...
...
src/operators/op_param.h
浏览文件 @
682b400f
...
@@ -371,7 +371,7 @@ class BatchNormParam : OpParam {
...
@@ -371,7 +371,7 @@ class BatchNormParam : OpParam {
input_variance_
=
InputVarianceFrom
<
LoDTensor
>
(
inputs
,
scope
);
input_variance_
=
InputVarianceFrom
<
LoDTensor
>
(
inputs
,
scope
);
epsilon_
=
GetAttr
<
float
>
(
"epsilon"
,
attrs
);
epsilon_
=
GetAttr
<
float
>
(
"epsilon"
,
attrs
);
momentum_
=
GetAttr
<
float
>
(
"momentum"
,
attrs
);
momentum_
=
GetAttr
<
float
>
(
"momentum"
,
attrs
);
is_test_
=
GetAttr
<
bool
>
(
"is_test"
,
attrs
);
//
is_test_ = GetAttr<bool>("is_test", attrs);
}
}
const
Tensor
*
InputX
()
const
{
return
input_x_
;
}
const
Tensor
*
InputX
()
const
{
return
input_x_
;
}
...
...
src/operators/pool_op.cpp
浏览文件 @
682b400f
...
@@ -54,7 +54,7 @@ void PoolOp<DeviceType, T>::InferShape() const {
...
@@ -54,7 +54,7 @@ void PoolOp<DeviceType, T>::InferShape() const {
}
}
this
->
param_
.
Output
()
->
Resize
(
framework
::
make_ddim
(
output_shape
));
this
->
param_
.
Output
()
->
Resize
(
framework
::
make_ddim
(
output_shape
));
}
}
template
class
PoolOp
<
CPU
,
float
>;
}
// namespace operators
}
// namespace operators
}
// namespace paddle_mobile
}
// namespace paddle_mobile
...
...
src/operators/prelu_op.cpp
浏览文件 @
682b400f
...
@@ -23,7 +23,7 @@ void PReluOp<Dtype, T>::InferShape() const {
...
@@ -23,7 +23,7 @@ void PReluOp<Dtype, T>::InferShape() const {
auto
input_dims
=
this
->
param_
.
InputX
()
->
dims
();
auto
input_dims
=
this
->
param_
.
InputX
()
->
dims
();
this
->
param_
.
Out
()
->
Resize
(
input_dims
);
this
->
param_
.
Out
()
->
Resize
(
input_dims
);
}
}
template
class
PReluOp
<
CPU
,
float
>;
}
// namespace operators
}
// namespace operators
}
// namespace paddle_mobile
}
// namespace paddle_mobile
...
...
src/operators/prior_box_op.cpp
浏览文件 @
682b400f
...
@@ -44,7 +44,7 @@ void PriorBoxOp<Dtype, T>::InferShape() const {
...
@@ -44,7 +44,7 @@ void PriorBoxOp<Dtype, T>::InferShape() const {
this
->
param_
.
OutputBoxes
()
->
Resize
(
framework
::
make_ddim
(
dim_vec
));
this
->
param_
.
OutputBoxes
()
->
Resize
(
framework
::
make_ddim
(
dim_vec
));
this
->
param_
.
OutputVariances
()
->
Resize
(
framework
::
make_ddim
(
dim_vec
));
this
->
param_
.
OutputVariances
()
->
Resize
(
framework
::
make_ddim
(
dim_vec
));
}
}
template
class
PriorBoxOp
<
CPU
,
float
>;
}
// namespace operators
}
// namespace operators
}
// namespace paddle_mobile
}
// namespace paddle_mobile
...
...
src/operators/relu_op.cpp
浏览文件 @
682b400f
...
@@ -23,7 +23,7 @@ void ReluOp<Dtype, T>::InferShape() const {
...
@@ -23,7 +23,7 @@ void ReluOp<Dtype, T>::InferShape() const {
auto
input_dims
=
this
->
param_
.
InputX
()
->
dims
();
auto
input_dims
=
this
->
param_
.
InputX
()
->
dims
();
this
->
param_
.
Out
()
->
Resize
(
input_dims
);
this
->
param_
.
Out
()
->
Resize
(
input_dims
);
}
}
template
class
ReluOp
<
CPU
,
float
>;
}
// namespace operators
}
// namespace operators
}
// namespace paddle_mobile
}
// namespace paddle_mobile
...
...
src/operators/reshape_op.cpp
浏览文件 @
682b400f
...
@@ -27,7 +27,7 @@ void ReshapeOp<Dtype, T>::InferShape() const {
...
@@ -27,7 +27,7 @@ void ReshapeOp<Dtype, T>::InferShape() const {
auto
out_dims
=
ValidateShape
(
shape
,
input_x_dims
);
auto
out_dims
=
ValidateShape
(
shape
,
input_x_dims
);
this
->
param_
.
Out
()
->
Resize
(
out_dims
);
this
->
param_
.
Out
()
->
Resize
(
out_dims
);
}
}
template
class
ReshapeOp
<
CPU
,
float
>;
}
// namespace operators
}
// namespace operators
}
// namespace paddle_mobile
}
// namespace paddle_mobile
...
...
src/operators/resize_op.cpp
浏览文件 @
682b400f
...
@@ -24,7 +24,7 @@ void ResizeOp<Dtype, T>::InferShape() const {
...
@@ -24,7 +24,7 @@ void ResizeOp<Dtype, T>::InferShape() const {
auto
out_dims
=
CalOutputShape
(
this
->
param_
);
auto
out_dims
=
CalOutputShape
(
this
->
param_
);
this
->
param_
.
Out
()
->
Resize
(
out_dims
);
this
->
param_
.
Out
()
->
Resize
(
out_dims
);
}
}
template
class
ResizeOp
<
CPU
,
float
>;
}
// namespace operators
}
// namespace operators
}
// namespace paddle_mobile
}
// namespace paddle_mobile
...
...
src/operators/scale_op.cpp
浏览文件 @
682b400f
...
@@ -24,7 +24,7 @@ void ScaleOp<Dtype, T>::InferShape() const {
...
@@ -24,7 +24,7 @@ void ScaleOp<Dtype, T>::InferShape() const {
auto
input_dims
=
this
->
param_
.
InputX
()
->
dims
();
auto
input_dims
=
this
->
param_
.
InputX
()
->
dims
();
this
->
param_
.
Out
()
->
Resize
(
input_dims
);
this
->
param_
.
Out
()
->
Resize
(
input_dims
);
}
}
template
class
ScaleOp
<
CPU
,
float
>;
}
// namespace operators
}
// namespace operators
}
// namespace paddle_mobile
}
// namespace paddle_mobile
...
...
src/operators/sigmoid_op.cpp
浏览文件 @
682b400f
...
@@ -22,7 +22,7 @@ template <typename DeviceType, typename T>
...
@@ -22,7 +22,7 @@ template <typename DeviceType, typename T>
void
SigmoidOp
<
DeviceType
,
T
>::
InferShape
()
const
{
void
SigmoidOp
<
DeviceType
,
T
>::
InferShape
()
const
{
this
->
param_
.
Out
()
->
Resize
(
this
->
param_
.
InputX
()
->
dims
());
this
->
param_
.
Out
()
->
Resize
(
this
->
param_
.
InputX
()
->
dims
());
}
}
template
class
SigmoidOp
<
CPU
,
float
>;
}
// namespace operators
}
// namespace operators
}
// namespace paddle_mobile
}
// namespace paddle_mobile
...
...
src/operators/slice_op.cpp
浏览文件 @
682b400f
...
@@ -23,7 +23,7 @@ template <typename Dtype, typename T>
...
@@ -23,7 +23,7 @@ template <typename Dtype, typename T>
void
SliceOp
<
Dtype
,
T
>::
InferShape
()
const
{
void
SliceOp
<
Dtype
,
T
>::
InferShape
()
const
{
/// todo: add InputShape() detection.
/// todo: add InputShape() detection.
}
}
template
class
SliceOp
<
CPU
,
float
>;
}
// namespace operators
}
// namespace operators
}
// namespace paddle_mobile
}
// namespace paddle_mobile
...
...
src/operators/softmax_op.cpp
浏览文件 @
682b400f
...
@@ -22,7 +22,7 @@ template <typename DeviceType, typename T>
...
@@ -22,7 +22,7 @@ template <typename DeviceType, typename T>
void
SoftmaxOp
<
DeviceType
,
T
>::
InferShape
()
const
{
void
SoftmaxOp
<
DeviceType
,
T
>::
InferShape
()
const
{
this
->
param_
.
Out
()
->
Resize
(
this
->
param_
.
InputX
()
->
dims
());
this
->
param_
.
Out
()
->
Resize
(
this
->
param_
.
InputX
()
->
dims
());
}
}
template
class
SoftmaxOp
<
CPU
,
float
>;
}
// namespace operators
}
// namespace operators
}
// namespace paddle_mobile
}
// namespace paddle_mobile
...
...
src/operators/transpose_op.cpp
浏览文件 @
682b400f
...
@@ -47,7 +47,7 @@ void TransposeOp<Dtype, T>::InferShape() const {
...
@@ -47,7 +47,7 @@ void TransposeOp<Dtype, T>::InferShape() const {
}
}
this
->
param_
.
Out
()
->
Resize
(
out_dims
);
this
->
param_
.
Out
()
->
Resize
(
out_dims
);
}
}
template
class
TransposeOp
<
CPU
,
float
>;
}
// namespace operators
}
// namespace operators
}
// namespace paddle_mobile
}
// namespace paddle_mobile
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录