Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
ff07dc31
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看板
提交
ff07dc31
编写于
10月 23, 2018
作者:
J
JiabinYang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
test=develop
上级
39d39775
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
8 addition
and
8 deletion
+8
-8
paddle/fluid/operators/reorg_op.cc
paddle/fluid/operators/reorg_op.cc
+2
-2
python/paddle/fluid/layers/nn.py
python/paddle/fluid/layers/nn.py
+2
-2
python/paddle/fluid/tests/unittests/test_layers.py
python/paddle/fluid/tests/unittests/test_layers.py
+1
-1
python/paddle/fluid/tests/unittests/test_reorg_op.py
python/paddle/fluid/tests/unittests/test_reorg_op.py
+3
-3
未找到文件。
paddle/fluid/operators/reorg_op.cc
浏览文件 @
ff07dc31
...
...
@@ -91,8 +91,8 @@ class ReorgOpMaker : public framework::OpProtoAndCheckerMaker {
Examples:
1. Given a
3-D tensor Input(X) with a shape [
2048, 26, 26], and the stride is 2, the reorg operator will transform Input(X)
into a
3-D tensor with shape [
2048, 13, 13] and leaving Input(X)'s data unchanged.
1. Given a
4-D tensor Input(X) with a shape [128,
2048, 26, 26], and the stride is 2, the reorg operator will transform Input(X)
into a
4-D tensor with shape [128,
2048, 13, 13] and leaving Input(X)'s data unchanged.
)DOC"
);
}
...
...
python/paddle/fluid/layers/nn.py
浏览文件 @
ff07dc31
...
...
@@ -7470,8 +7470,8 @@ def reorg(x, stride, name=None):
x=data, stride=2)
"""
if
not
(
isinstance
(
stride
,
long
)):
raise
ValueError
(
"stride must be a python
long
"
)
if
not
(
isinstance
(
stride
,
int
)):
raise
ValueError
(
"stride must be a python
Int
"
)
helper
=
LayerHelper
(
"reorg"
,
**
locals
())
if
name
is
None
:
...
...
python/paddle/fluid/tests/unittests/test_layers.py
浏览文件 @
ff07dc31
...
...
@@ -256,7 +256,7 @@ class TestBook(unittest.TestCase):
shape
=
[
32
,
9
,
6
,
6
],
append_batch_size
=
False
,
dtype
=
'float32'
)
self
.
assertIsNotNone
(
layers
.
reorg
(
data
,
long
(
3
)
))
self
.
assertIsNotNone
(
layers
.
reorg
(
data
,
3
))
print
(
str
(
program
))
def
test_sequence_unsqueeze
(
self
):
...
...
python/paddle/fluid/tests/unittests/test_reorg_op.py
浏览文件 @
ff07dc31
...
...
@@ -22,16 +22,16 @@ from op_test import OpTest
class
TestReorgOp
(
OpTest
):
@
staticmethod
def
helper
(
in_
,
width
,
height
,
channel
,
batch
,
stride
,
forward
,
out_
):
channel_out
=
channel
/
(
stride
*
stride
)
channel_out
=
channel
/
/
(
stride
*
stride
)
for
b
in
range
(
batch
):
for
k
in
range
(
channel
):
for
j
in
range
(
height
):
for
i
in
range
(
width
):
in_index
=
i
+
width
*
(
j
+
height
*
(
k
+
channel
*
b
))
channel2
=
k
%
channel_out
offset
=
k
/
channel_out
offset
=
k
/
/
channel_out
width2
=
i
*
stride
+
offset
%
stride
height2
=
j
*
stride
+
offset
/
stride
height2
=
j
*
stride
+
offset
/
/
stride
out_index
=
width2
+
width
*
stride
*
(
height2
+
height
*
stride
*
(
channel2
+
channel_out
*
b
))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录