Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
夏有凉风,冬有雪
Paddle
提交
f1ab13bd
P
Paddle
项目概览
夏有凉风,冬有雪
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f1ab13bd
编写于
12月 19, 2017
作者:
C
chengduoZH
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refine
上级
293b292e
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
14 addition
and
11 deletion
+14
-11
paddle/operators/elementwise_op_function.h
paddle/operators/elementwise_op_function.h
+3
-3
paddle/operators/math/im2col.cc
paddle/operators/math/im2col.cc
+11
-8
未找到文件。
paddle/operators/elementwise_op_function.h
浏览文件 @
f1ab13bd
...
@@ -105,8 +105,8 @@ class MidWiseTransformIterator<T, platform::CPUDeviceContext> {
...
@@ -105,8 +105,8 @@ class MidWiseTransformIterator<T, platform::CPUDeviceContext> {
++
j_
;
++
j_
;
if
(
UNLIKELY
(
j_
==
post_
))
{
if
(
UNLIKELY
(
j_
==
post_
))
{
++
i_
;
++
i_
;
if
(
UNLIKELY
(
i_
==
n_
))
{
j_
=
0
;
j_
=
0
;
if
(
UNLIKELY
(
i_
==
n_
))
{
i_
=
0
;
i_
=
0
;
}
}
}
}
...
@@ -127,10 +127,10 @@ class MidWiseTransformIterator<T, platform::CPUDeviceContext> {
...
@@ -127,10 +127,10 @@ class MidWiseTransformIterator<T, platform::CPUDeviceContext> {
private:
private:
const
T
*
ptr_
;
const
T
*
ptr_
;
int
i_
;
int
64_t
i_
;
int64_t
j_
;
int64_t
j_
;
int64_t
n_
;
int64_t
n_
;
int
post_
;
int
64_t
post_
;
};
};
#ifdef __NVCC__
#ifdef __NVCC__
...
...
paddle/operators/math/im2col.cc
浏览文件 @
f1ab13bd
...
@@ -66,10 +66,10 @@ class Im2ColFunctor<paddle::operators::math::ColFormat::kCFO,
...
@@ -66,10 +66,10 @@ class Im2ColFunctor<paddle::operators::math::ColFormat::kCFO,
int
c_im
=
0
;
int
c_im
=
0
;
for
(
int
c
=
0
;
c
<
channels_col
;
++
c
)
{
for
(
int
c
=
0
;
c
<
channels_col
;
++
c
)
{
++
w_offset
;
++
w_offset
;
if
(
UNLIKELY
(
w_offset
==
filter_width
)
)
{
if
(
w_offset
==
filter_width
)
{
w_offset
=
0
;
w_offset
=
0
;
++
h_offset
;
++
h_offset
;
if
(
UNLIKELY
(
h_offset
==
filter_height
)
)
{
if
(
h_offset
==
filter_height
)
{
h_offset
=
0
;
h_offset
=
0
;
++
c_im
;
++
c_im
;
}
}
...
@@ -140,10 +140,10 @@ class Col2ImFunctor<paddle::operators::math::ColFormat::kCFO,
...
@@ -140,10 +140,10 @@ class Col2ImFunctor<paddle::operators::math::ColFormat::kCFO,
int
c_im
=
0
;
int
c_im
=
0
;
for
(
int
c
=
0
;
c
<
channels_col
;
++
c
)
{
for
(
int
c
=
0
;
c
<
channels_col
;
++
c
)
{
++
w_offset
;
++
w_offset
;
if
(
UNLIKELY
(
w_offset
==
filter_width
)
)
{
if
(
w_offset
==
filter_width
)
{
w_offset
=
0
;
w_offset
=
0
;
++
h_offset
;
++
h_offset
;
if
(
UNLIKELY
(
h_offset
==
filter_height
)
)
{
if
(
h_offset
==
filter_height
)
{
h_offset
=
0
;
h_offset
=
0
;
++
c_im
;
++
c_im
;
}
}
...
@@ -214,12 +214,13 @@ class Im2ColFunctor<paddle::operators::math::ColFormat::kOCF,
...
@@ -214,12 +214,13 @@ class Im2ColFunctor<paddle::operators::math::ColFormat::kOCF,
for
(
int
channel
=
0
;
channel
<
im_channels
;
++
channel
)
{
for
(
int
channel
=
0
;
channel
<
im_channels
;
++
channel
)
{
for
(
int
filter_row_idx
=
0
;
filter_row_idx
<
filter_height
;
for
(
int
filter_row_idx
=
0
;
filter_row_idx
<
filter_height
;
++
filter_row_idx
)
{
++
filter_row_idx
)
{
for
(
int
filter_col_idx
=
0
;
filter_col_idx
<
filter_width
;
++
filter_col_idx
)
{
int
im_row_offset
=
int
im_row_offset
=
col_row_idx
*
stride
[
0
]
+
filter_row_idx
-
padding
[
0
];
col_row_idx
*
stride
[
0
]
+
filter_row_idx
-
padding
[
0
];
for
(
int
filter_col_idx
=
0
;
filter_col_idx
<
filter_width
;
++
filter_col_idx
)
{
int
im_col_offset
=
int
im_col_offset
=
col_col_idx
*
stride
[
1
]
+
filter_col_idx
-
padding
[
1
];
col_col_idx
*
stride
[
1
]
+
filter_col_idx
-
padding
[
1
];
int
col_offset
=
int
col_offset
=
((((
col_row_idx
)
*
col_width
+
col_col_idx
)
*
im_channels
+
((((
col_row_idx
)
*
col_width
+
col_col_idx
)
*
im_channels
+
channel
)
*
channel
)
*
...
@@ -286,12 +287,13 @@ class Col2ImFunctor<paddle::operators::math::ColFormat::kOCF,
...
@@ -286,12 +287,13 @@ class Col2ImFunctor<paddle::operators::math::ColFormat::kOCF,
for
(
int
channel
=
0
;
channel
<
im_channels
;
++
channel
)
{
for
(
int
channel
=
0
;
channel
<
im_channels
;
++
channel
)
{
for
(
int
filter_row_idx
=
0
;
filter_row_idx
<
filter_height
;
for
(
int
filter_row_idx
=
0
;
filter_row_idx
<
filter_height
;
++
filter_row_idx
)
{
++
filter_row_idx
)
{
for
(
int
filter_col_idx
=
0
;
filter_col_idx
<
filter_width
;
++
filter_col_idx
)
{
int
im_row_offset
=
int
im_row_offset
=
col_row_idx
*
stride
[
0
]
+
filter_row_idx
-
padding
[
0
];
col_row_idx
*
stride
[
0
]
+
filter_row_idx
-
padding
[
0
];
for
(
int
filter_col_idx
=
0
;
filter_col_idx
<
filter_width
;
++
filter_col_idx
)
{
int
im_col_offset
=
int
im_col_offset
=
col_col_idx
*
stride
[
1
]
+
filter_col_idx
-
padding
[
1
];
col_col_idx
*
stride
[
1
]
+
filter_col_idx
-
padding
[
1
];
int
col_offset
=
int
col_offset
=
(((
col_row_idx
*
col_width
+
col_col_idx
)
*
im_channels
+
(((
col_row_idx
*
col_width
+
col_col_idx
)
*
im_channels
+
channel
)
*
channel
)
*
...
@@ -299,6 +301,7 @@ class Col2ImFunctor<paddle::operators::math::ColFormat::kOCF,
...
@@ -299,6 +301,7 @@ class Col2ImFunctor<paddle::operators::math::ColFormat::kOCF,
filter_row_idx
)
*
filter_row_idx
)
*
filter_width
+
filter_width
+
filter_col_idx
;
filter_col_idx
;
if
(
im_row_offset
>=
0
&&
im_row_offset
<
im_height
&&
if
(
im_row_offset
>=
0
&&
im_row_offset
<
im_height
&&
im_col_offset
>=
0
&&
im_col_offset
<
im_width
)
{
im_col_offset
>=
0
&&
im_col_offset
<
im_width
)
{
int
im_offset
=
int
im_offset
=
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录