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