Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle-Lite
提交
11eb4d6f
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看板
提交
11eb4d6f
编写于
7月 02, 2018
作者:
Y
Yao,kun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix codestyle
上级
733fc7ef
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
63 addition
and
61 deletion
+63
-61
src/operators/dropout_op.h
src/operators/dropout_op.h
+4
-4
src/operators/im2sequence_op.h
src/operators/im2sequence_op.h
+6
-4
src/operators/kernel/arm/dropout_kernel.cpp
src/operators/kernel/arm/dropout_kernel.cpp
+2
-2
src/operators/kernel/arm/im2sequence_kernel.cpp
src/operators/kernel/arm/im2sequence_kernel.cpp
+1
-1
src/operators/kernel/dropout_kernel.h
src/operators/kernel/dropout_kernel.h
+1
-1
src/operators/op_param.h
src/operators/op_param.h
+49
-49
未找到文件。
src/operators/dropout_op.h
浏览文件 @
11eb4d6f
...
@@ -28,8 +28,9 @@ namespace operators {
...
@@ -28,8 +28,9 @@ namespace operators {
using
paddle_mobile
::
framework
::
Tensor
;
using
paddle_mobile
::
framework
::
Tensor
;
template
<
typename
DeviceType
,
typename
T
>
template
<
typename
DeviceType
,
typename
T
>
class
DropoutOp
:
public
framework
::
OperatorWithKernel
<
DeviceType
,
DropoutParam
,
class
DropoutOp
operators
::
DropoutKernal
<
DeviceType
,
T
>>
{
:
public
framework
::
OperatorWithKernel
<
DeviceType
,
DropoutParam
,
operators
::
DropoutKernal
<
DeviceType
,
T
>>
{
public:
public:
DropoutOp
(
const
std
::
string
&
type
,
const
VariableNameMap
&
inputs
,
DropoutOp
(
const
std
::
string
&
type
,
const
VariableNameMap
&
inputs
,
const
VariableNameMap
&
outputs
,
const
framework
::
AttributeMap
attrs
,
const
VariableNameMap
&
outputs
,
const
framework
::
AttributeMap
attrs
,
...
@@ -39,7 +40,7 @@ class DropoutOp : public framework::OperatorWithKernel<DeviceType, DropoutParam,
...
@@ -39,7 +40,7 @@ class DropoutOp : public framework::OperatorWithKernel<DeviceType, DropoutParam,
param_
(
inputs
,
outputs
,
attrs
,
*
scope
)
{}
param_
(
inputs
,
outputs
,
attrs
,
*
scope
)
{}
using
framework
::
OperatorWithKernel
<
DeviceType
,
DropoutParam
,
using
framework
::
OperatorWithKernel
<
DeviceType
,
DropoutParam
,
operators
::
DropoutKernel
<
DeviceType
,
T
>>
;
operators
::
DropoutKernel
<
DeviceType
,
T
>>
;
void
InferShape
()
const
override
;
void
InferShape
()
const
override
;
protected:
protected:
...
@@ -49,4 +50,3 @@ class DropoutOp : public framework::OperatorWithKernel<DeviceType, DropoutParam,
...
@@ -49,4 +50,3 @@ class DropoutOp : public framework::OperatorWithKernel<DeviceType, DropoutParam,
}
// namespace paddle_mobile
}
// namespace paddle_mobile
#endif
#endif
src/operators/im2sequence_op.h
浏览文件 @
11eb4d6f
...
@@ -26,8 +26,9 @@ namespace operators {
...
@@ -26,8 +26,9 @@ namespace operators {
using
namespace
framework
;
using
namespace
framework
;
template
<
typename
DeviceType
,
typename
T
>
template
<
typename
DeviceType
,
typename
T
>
class
Im2SequenceOp
:
public
framework
::
OperatorWithKernel
<
DeviceType
,
Im2SequenceParam
,
class
Im2SequenceOp
:
public
framework
::
OperatorWithKernel
<
operators
::
Im2SequenceKernal
<
DeviceType
,
T
>>
{
DeviceType
,
Im2SequenceParam
,
operators
::
Im2SequenceKernal
<
DeviceType
,
T
>>
{
public:
public:
Im2SequenceOp
(
const
std
::
string
&
type
,
const
VariableNameMap
&
inputs
,
Im2SequenceOp
(
const
std
::
string
&
type
,
const
VariableNameMap
&
inputs
,
const
VariableNameMap
&
outputs
,
const
VariableNameMap
&
outputs
,
...
@@ -37,8 +38,9 @@ class Im2SequenceOp : public framework::OperatorWithKernel<DeviceType, Im2Sequen
...
@@ -37,8 +38,9 @@ class Im2SequenceOp : public framework::OperatorWithKernel<DeviceType, Im2Sequen
scope
),
scope
),
param_
(
inputs
,
outputs
,
attrs
,
*
scope
)
{}
param_
(
inputs
,
outputs
,
attrs
,
*
scope
)
{}
using
framework
::
OperatorWithKernel
<
DeviceType
,
Im2SequenceParam
,
using
framework
::
OperatorWithKernel
<
operators
::
Im2SequenceKernel
<
DeviceType
,
T
>>::
OperatorWithKernel
;
DeviceType
,
Im2SequenceParam
,
operators
::
Im2SequenceKernel
<
DeviceType
,
T
>>::
OperatorWithKernel
;
void
InferShape
()
const
override
;
void
InferShape
()
const
override
;
private:
private:
...
...
src/operators/kernel/arm/dropout_kernel.cpp
浏览文件 @
11eb4d6f
...
@@ -22,9 +22,9 @@ namespace operators {
...
@@ -22,9 +22,9 @@ namespace operators {
template
<
>
template
<
>
bool
DropoutKernel
<
CPU
,
float
>::
Init
(
const
DropoutParam
&
para
)
const
{
bool
DropoutKernel
<
CPU
,
float
>::
Init
(
const
DropoutParam
&
para
)
const
{
return
true
;
return
true
;
}
}
template
<
typename
T
>
template
<
typename
T
>
struct
DropoutFunctor
{
struct
DropoutFunctor
{
inline
T
operator
()(
T
in
)
const
{
return
in
;
}
inline
T
operator
()(
T
in
)
const
{
return
in
;
}
...
...
src/operators/kernel/arm/im2sequence_kernel.cpp
浏览文件 @
11eb4d6f
...
@@ -21,7 +21,7 @@ template <>
...
@@ -21,7 +21,7 @@ template <>
bool
Im2SequenceKernel
<
CPU
,
float
>::
Init
(
const
Im2SequenceParam
&
para
)
const
{
bool
Im2SequenceKernel
<
CPU
,
float
>::
Init
(
const
Im2SequenceParam
&
para
)
const
{
return
true
;
return
true
;
}
}
inline
int
Im2SeqOutputSize
(
int
input_size
,
int
filter_size
,
int
padding_0
,
inline
int
Im2SeqOutputSize
(
int
input_size
,
int
filter_size
,
int
padding_0
,
int
padding_1
,
int
stride
)
{
int
padding_1
,
int
stride
)
{
const
int
output_size
=
const
int
output_size
=
...
...
src/operators/kernel/dropout_kernel.h
浏览文件 @
11eb4d6f
...
@@ -24,7 +24,7 @@ template <typename DeviceType, typename T>
...
@@ -24,7 +24,7 @@ template <typename DeviceType, typename T>
class
DropoutKernel
:
public
framework
::
OpKernelBase
<
DeviceType
,
DropoutParam
>
{
class
DropoutKernel
:
public
framework
::
OpKernelBase
<
DeviceType
,
DropoutParam
>
{
public:
public:
void
Compute
(
const
DropoutParam
&
param
)
const
;
void
Compute
(
const
DropoutParam
&
param
)
const
;
bool
Init
(
const
DropoutParam
&
para
)
const
;
bool
Init
(
const
DropoutParam
&
para
)
const
;
};
};
}
// namespace operators
}
// namespace operators
}
// namespace paddle_mobile
}
// namespace paddle_mobile
src/operators/op_param.h
浏览文件 @
11eb4d6f
...
@@ -934,57 +934,57 @@ class FusionConvAddBNReluParam : public OpParam {
...
@@ -934,57 +934,57 @@ class FusionConvAddBNReluParam : public OpParam {
Print
&
operator
<<
(
Print
&
printer
,
const
FusionConvAddParam
&
conv_param
);
Print
&
operator
<<
(
Print
&
printer
,
const
FusionConvAddParam
&
conv_param
);
#endif
#endif
#ifdef IM2SEQUENCE_OP
#ifdef IM2SEQUENCE_OP
class
Im2SequenceParam
:
public
OpParam
{
class
Im2SequenceParam
:
public
OpParam
{
public:
public:
Im2SequenceParam
(
const
VariableNameMap
&
inputs
,
Im2SequenceParam
(
const
VariableNameMap
&
inputs
,
const
VariableNameMap
&
outputs
,
const
AttributeMap
&
attrs
,
const
VariableNameMap
&
outputs
,
const
AttributeMap
&
attrs
,
const
Scope
&
scope
)
{
const
Scope
&
scope
)
{
input_x_
=
InputXFrom
<
LoDTensor
>
(
inputs
,
scope
);
input_x_
=
InputXFrom
<
LoDTensor
>
(
inputs
,
scope
);
out_
=
OutFrom
<
LoDTensor
>
(
outputs
,
scope
);
out_
=
OutFrom
<
LoDTensor
>
(
outputs
,
scope
);
kernels_
=
GetAttr
<
vector
<
int
>>
(
"kernels"
,
attrs
);
kernels_
=
GetAttr
<
vector
<
int
>>
(
"kernels"
,
attrs
);
strides_
=
GetAttr
<
vector
<
int
>>
(
"strides"
,
attrs
);
strides_
=
GetAttr
<
vector
<
int
>>
(
"strides"
,
attrs
);
paddings_
=
GetAttr
<
vector
<
int
>>
(
"paddings"
,
attrs
);
paddings_
=
GetAttr
<
vector
<
int
>>
(
"paddings"
,
attrs
);
}
}
const
Tensor
*
Input
()
const
{
return
input_x_
;
}
const
Tensor
*
Input
()
const
{
return
input_x_
;
}
Tensor
*
Output
()
const
{
return
out_
;
}
Tensor
*
Output
()
const
{
return
out_
;
}
const
vector
<
int
>
&
Kernels
()
const
{
return
kernels_
;
}
const
vector
<
int
>
&
Kernels
()
const
{
return
kernels_
;
}
const
vector
<
int
>
&
Strides
()
const
{
return
strides_
;
}
const
vector
<
int
>
&
Strides
()
const
{
return
strides_
;
}
const
vector
<
int
>
&
Paddings
()
const
{
return
paddings_
;
}
const
vector
<
int
>
&
Paddings
()
const
{
return
paddings_
;
}
private:
private:
Tensor
*
input_x_
;
Tensor
*
input_x_
;
Tensor
*
out_
;
Tensor
*
out_
;
vector
<
int
>
kernels_
;
vector
<
int
>
kernels_
;
vector
<
int
>
strides_
;
vector
<
int
>
strides_
;
vector
<
int
>
paddings_
;
vector
<
int
>
paddings_
;
};
};
#endif
#endif
#ifdef DROPOUT_OP
#ifdef DROPOUT_OP
class
DropoutParam
:
public
OpParam
{
class
DropoutParam
:
public
OpParam
{
public:
public:
DropoutParam
(
const
VariableNameMap
&
inputs
,
const
VariableNameMap
&
outputs
,
DropoutParam
(
const
VariableNameMap
&
inputs
,
const
VariableNameMap
&
outputs
,
const
AttributeMap
&
attrs
,
const
Scope
&
scope
)
{
const
AttributeMap
&
attrs
,
const
Scope
&
scope
)
{
input_x_
=
InputXFrom
<
LoDTensor
>
(
inputs
,
scope
);
input_x_
=
InputXFrom
<
LoDTensor
>
(
inputs
,
scope
);
out_
=
OutFrom
<
LoDTensor
>
(
outputs
,
scope
);
out_
=
OutFrom
<
LoDTensor
>
(
outputs
,
scope
);
}
}
const
Tensor
*
InputX
()
const
{
return
input_x_
;
}
const
Tensor
*
InputX
()
const
{
return
input_x_
;
}
Tensor
*
Out
()
const
{
return
out_
;
}
Tensor
*
Out
()
const
{
return
out_
;
}
private:
private:
Tensor
*
input_x_
;
Tensor
*
input_x_
;
Tensor
*
out_
;
Tensor
*
out_
;
};
};
#endif
#endif
}
// 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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录