Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle-Lite
提交
a9c578e8
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看板
提交
a9c578e8
编写于
6月 15, 2018
作者:
E
eclipsess
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix template class double
上级
ece4316e
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
24 addition
and
2 deletion
+24
-2
src/operators/math/im2col.cpp
src/operators/math/im2col.cpp
+24
-2
未找到文件。
src/operators/math/im2col.cpp
浏览文件 @
a9c578e8
...
...
@@ -14,7 +14,9 @@ limitations under the License. */
#include "operators/math/im2col.h"
#include <vector>
#ifdef __ARM_NEON
#include "arm_neon.h"
#endif
#include "common/types.h"
namespace
paddle_mobile
{
namespace
operators
{
...
...
@@ -67,7 +69,7 @@ class Im2ColFunctor<ColFormat::kCFO, CPU, T> {
int
channels_col
=
im_channels
*
filter_height
*
filter_width
;
const
T
*
im_data
=
im
.
data
<
T
>
();
T
*
col_data
=
col
->
data
<
T
>
();
#ifdef __ARM_NEON
const
int
osize
=
col_height
;
const
int
isize
=
im_height
;
bool
pad1
=
padding
[
0
]
>
0
;
...
...
@@ -408,6 +410,26 @@ class Im2ColFunctor<ColFormat::kCFO, CPU, T> {
}
}
}
#else
for
(
int
c
=
0
;
c
<
channels_col
;
++
c
)
{
int
w_offset
=
c
%
filter_width
;
int
h_offset
=
(
c
/
filter_width
)
%
filter_height
;
int
c_im
=
c
/
(
filter_width
*
filter_height
);
for
(
int
h
=
0
;
h
<
col_height
;
++
h
)
{
int
im_row_idx
=
h
*
stride
[
0
]
-
padding
[
0
]
+
h_offset
*
dilation
[
0
];
for
(
int
w
=
0
;
w
<
col_width
;
++
w
)
{
int
im_col_idx
=
w
*
stride
[
1
]
-
padding
[
1
]
+
w_offset
*
dilation
[
1
];
int
col_idx
=
(
c
*
col_height
+
h
)
*
col_width
+
w
;
int
im_idx
=
(
im_row_idx
+
c_im
*
im_height
)
*
im_width
+
im_col_idx
;
col_data
[
col_idx
]
=
(
im_row_idx
<
0
||
im_row_idx
>=
im_height
||
im_col_idx
<
0
||
im_col_idx
>=
im_width
)
?
static_cast
<
T
>
(
0
)
:
im_data
[
im_idx
];
}
}
}
#endif
}
};
...
...
@@ -480,7 +502,7 @@ class Col2ImFunctor<ColFormat::kCFO, CPU, T> {
};
template
class
Im2ColFunctor
<
ColFormat
::
kCFO
,
CPU
,
float
>;
template
class
Im2ColFunctor
<
ColFormat
::
kCFO
,
CPU
,
double
>;
//
template class Im2ColFunctor<ColFormat::kCFO, CPU, double>;
template
class
Col2ImFunctor
<
ColFormat
::
kCFO
,
CPU
,
float
>;
template
class
Col2ImFunctor
<
ColFormat
::
kCFO
,
CPU
,
double
>;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录