Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle-Lite
提交
2cd8c947
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看板
提交
2cd8c947
编写于
7月 02, 2018
作者:
Y
Yao,kun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
bugfix
上级
0186dee5
变更
9
显示空白变更内容
内联
并排
Showing
9 changed file
with
21 addition
and
23 deletion
+21
-23
src/operators/dropout_op.cpp
src/operators/dropout_op.cpp
+3
-3
src/operators/dropout_op.h
src/operators/dropout_op.h
+3
-4
src/operators/im2sequence_op.cpp
src/operators/im2sequence_op.cpp
+5
-5
src/operators/im2sequence_op.h
src/operators/im2sequence_op.h
+4
-5
src/operators/kernel/arm/dropout_kernel.cpp
src/operators/kernel/arm/dropout_kernel.cpp
+1
-1
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/kernel/im2sequence_kernel.h
src/operators/kernel/im2sequence_kernel.h
+1
-1
tools/op.cmake
tools/op.cmake
+2
-2
未找到文件。
src/operators/dropout_op.cpp
浏览文件 @
2cd8c947
...
...
@@ -19,8 +19,8 @@ namespace operators {
template
<
typename
Dtype
,
typename
T
>
void
DropoutOp
<
Dtype
,
T
>::
InferShape
()
const
{
auto
input_dims
=
param_
.
InputX
()
->
dims
();
param_
.
Out
()
->
Resize
(
input_dims
);
auto
input_dims
=
thsi
->
param_
.
InputX
()
->
dims
();
this
->
param_
.
Out
()
->
Resize
(
input_dims
);
}
template
class
DropoutOp
<
CPU
,
float
>;
}
// namespace operators
...
...
@@ -28,7 +28,7 @@ template class DropoutOp<CPU, float>;
namespace
ops
=
paddle_mobile
::
operators
;
#ifdef PADDLE_MOBILE_CPU
USE_OP_CPU
(
D
ropout
);
USE_OP_CPU
(
d
ropout
);
REGISTER_OPERATOR_CPU
(
dropout
,
ops
::
DropoutOp
);
#endif
#ifdef PADDLE_MOBILE_MALI_GPU
...
...
src/operators/dropout_op.h
浏览文件 @
2cd8c947
...
...
@@ -37,11 +37,10 @@ class DropoutOp
std
::
shared_ptr
<
framework
::
Scope
>
scope
)
:
framework
::
OperatorWithKernel
<
DeviceType
,
DropoutParam
,
operators
::
DropoutKernel
<
DeviceType
,
T
>>
(
type
,
inputs
,
outputs
,
attrs
,
scope
),
param_
(
inputs
,
outputs
,
attrs
,
*
scope
)
{}
type
,
inputs
,
outputs
,
attrs
,
scope
)
{}
using
framework
::
OperatorWithKernel
<
DeviceType
,
DropoutParam
,
operators
::
DropoutKernel
<
DeviceType
,
T
>>
;
//
using framework::OperatorWithKernel<DeviceType, DropoutParam,
//
operators::DropoutKernel<DeviceType, T>>;
void
InferShape
()
const
override
;
protected:
...
...
src/operators/im2sequence_op.cpp
浏览文件 @
2cd8c947
...
...
@@ -28,13 +28,13 @@ int Im2SequenceOutputSize(int input_size, int kernel, int padding_1,
template
<
typename
Dtype
,
typename
T
>
void
Im2SequenceOp
<
Dtype
,
T
>::
InferShape
()
const
{
auto
in_x_dims
=
param_
.
Input
()
->
dims
();
auto
in_x_dims
=
this
->
param_
.
Input
()
->
dims
();
const
std
::
vector
<
int
>
&
kernels
=
param_
.
Kernels
();
const
std
::
vector
<
int
>
&
kernels
=
this
->
param_
.
Kernels
();
const
std
::
vector
<
int
>
&
strides
=
param_
.
Strides
();
const
std
::
vector
<
int
>
&
strides
=
this
->
param_
.
Strides
();
std
::
vector
<
int
>
paddings
=
param_
.
Paddings
();
std
::
vector
<
int
>
paddings
=
this
->
param_
.
Paddings
();
std
::
vector
<
int64_t
>
output_shape
({
in_x_dims
[
0
],
in_x_dims
[
1
]});
for
(
size_t
i
=
0
;
i
<
strides
.
size
();
++
i
)
{
...
...
@@ -44,7 +44,7 @@ void Im2SequenceOp<Dtype, T>::InferShape() const {
}
framework
::
DDim
ddim
=
framework
::
make_ddim
(
output_shape
);
param_
.
Output
()
->
Resize
(
ddim
);
this
->
param_
.
Output
()
->
Resize
(
ddim
);
}
template
class
Im2SequenceOp
<
CPU
,
float
>;
...
...
src/operators/im2sequence_op.h
浏览文件 @
2cd8c947
...
...
@@ -37,12 +37,11 @@ class Im2SequenceOp : public framework::OperatorWithKernel<
:
framework
::
OperatorWithKernel
<
DeviceType
,
Im2SequenceParam
,
operators
::
Im2SequenceKernel
<
DeviceType
,
T
>>
(
type
,
inputs
,
outputs
,
attrs
,
scope
),
param_
(
inputs
,
outputs
,
attrs
,
*
scope
)
{}
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
浏览文件 @
2cd8c947
...
...
@@ -23,7 +23,7 @@ namespace paddle_mobile {
namespace
operators
{
template
<
>
bool
DropoutKernel
<
CPU
,
float
>::
Init
(
const
DropoutParam
&
para
)
const
{
bool
DropoutKernel
<
CPU
,
float
>::
Init
(
DropoutParam
*
para
)
{
return
true
;
}
...
...
src/operators/kernel/arm/im2sequence_kernel.cpp
浏览文件 @
2cd8c947
...
...
@@ -20,7 +20,7 @@ namespace paddle_mobile {
namespace
operators
{
template
<
>
bool
Im2SequenceKernel
<
CPU
,
float
>::
Init
(
const
Im2SequenceParam
&
para
)
const
{
bool
Im2SequenceKernel
<
CPU
,
float
>::
Init
(
Im2SequenceParam
*
para
)
{
return
true
;
}
...
...
src/operators/kernel/dropout_kernel.h
浏览文件 @
2cd8c947
...
...
@@ -26,7 +26,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
(
DropoutParam
*
para
)
;
};
}
// namespace operators
}
// namespace paddle_mobile
...
...
src/operators/kernel/im2sequence_kernel.h
浏览文件 @
2cd8c947
...
...
@@ -32,7 +32,7 @@ class Im2SequenceKernel
:
public
framework
::
OpKernelBase
<
DeviceType
,
Im2SequenceParam
>
{
public:
void
Compute
(
const
Im2SequenceParam
&
param
)
const
;
bool
Init
(
const
Im2SequenceParam
&
para
)
const
;
bool
Init
(
Im2SequenceParam
*
para
)
;
};
}
// namespace operators
}
// namespace paddle_mobile
...
...
tools/op.cmake
浏览文件 @
2cd8c947
...
...
@@ -156,6 +156,6 @@ endif()
if
(
DROPOUT_OP
)
add_definitions
(
-DDROPOUT_OP
)
endif
()
if
(
IM2SQUENCE_OP
)
add_definitions
(
-DIM2SQUENCE_OP
)
if
(
IM2S
E
QUENCE_OP
)
add_definitions
(
-DIM2S
E
QUENCE_OP
)
endif
()
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录