Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Crayon鑫
Paddle
提交
0b74428d
P
Paddle
项目概览
Crayon鑫
/
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看板
未验证
提交
0b74428d
编写于
12月 25, 2020
作者:
L
LielinJiang
提交者:
GitHub
12月 25, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix Conv2DTanspose bug when padding='same' (#29915)
* fix conv_transpose bug when padding=same
上级
11de384c
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
6 addition
and
6 deletion
+6
-6
python/paddle/fluid/tests/unittests/test_conv2d_transpose_layer.py
...ddle/fluid/tests/unittests/test_conv2d_transpose_layer.py
+1
-0
python/paddle/nn/layer/conv.py
python/paddle/nn/layer/conv.py
+5
-6
未找到文件。
python/paddle/fluid/tests/unittests/test_conv2d_transpose_layer.py
浏览文件 @
0b74428d
...
@@ -219,6 +219,7 @@ def add_cases(suite):
...
@@ -219,6 +219,7 @@ def add_cases(suite):
suite
.
addTest
(
suite
.
addTest
(
Conv2DTransposeTestCase
(
Conv2DTransposeTestCase
(
methodName
=
'runTest'
,
padding
=
"valid"
))
methodName
=
'runTest'
,
padding
=
"valid"
))
suite
.
addTest
(
Conv2DTransposeTestCase
(
methodName
=
'runTest'
,
padding
=
"same"
))
suite
.
addTest
(
suite
.
addTest
(
Conv2DTransposeTestCase
(
Conv2DTransposeTestCase
(
methodName
=
'runTest'
,
filter_size
=
1
,
padding
=
(
2
,
3
)))
methodName
=
'runTest'
,
filter_size
=
1
,
padding
=
(
2
,
3
)))
...
...
python/paddle/nn/layer/conv.py
浏览文件 @
0b74428d
...
@@ -100,14 +100,12 @@ class _ConvNd(layers.Layer):
...
@@ -100,14 +100,12 @@ class _ConvNd(layers.Layer):
self
.
_padding_mode
=
padding_mode
self
.
_padding_mode
=
padding_mode
self
.
output_padding
=
output_padding
self
.
output_padding
=
output_padding
if
dims
!=
1
:
if
dims
!=
1
:
self
.
_padding
,
self
.
_padding_algorithm
=
_update_padding_nd
(
self
.
_
updated_
padding
,
self
.
_padding_algorithm
=
_update_padding_nd
(
padding
,
channel_last
,
dims
)
padding
,
channel_last
,
dims
)
if
transposed
:
if
transposed
:
filter_shape
=
[
self
.
_in_channels
,
out_channels
//
groups
filter_shape
=
[
self
.
_in_channels
,
out_channels
//
groups
]
+
self
.
_kernel_size
]
+
self
.
_kernel_size
self
.
_padding
,
self
.
_padding_algorithm
=
_update_padding_nd
(
padding
,
channel_last
,
dims
)
else
:
else
:
if
in_channels
%
groups
!=
0
:
if
in_channels
%
groups
!=
0
:
raise
ValueError
(
"in_channels must be divisible by groups."
)
raise
ValueError
(
"in_channels must be divisible by groups."
)
...
@@ -118,7 +116,8 @@ class _ConvNd(layers.Layer):
...
@@ -118,7 +116,8 @@ class _ConvNd(layers.Layer):
self
.
_reversed_padding_repeated_twice
=
_reverse_repeat_list
(
self
.
_reversed_padding_repeated_twice
=
_reverse_repeat_list
(
_paired_padding
,
2
)
_paired_padding
,
2
)
self
.
_padding
,
_
=
_update_padding_nd
(
0
,
channel_last
,
dims
)
self
.
_updated_padding
,
self
.
_padding_algorithm
=
_update_padding_nd
(
0
,
channel_last
,
dims
)
filter_shape
=
[
out_channels
,
in_channels
//
groups
filter_shape
=
[
out_channels
,
in_channels
//
groups
]
+
self
.
_kernel_size
]
+
self
.
_kernel_size
...
@@ -634,7 +633,7 @@ class Conv2D(_ConvNd):
...
@@ -634,7 +633,7 @@ class Conv2D(_ConvNd):
self
.
weight
,
self
.
weight
,
bias
=
self
.
bias
,
bias
=
self
.
bias
,
stride
=
self
.
_stride
,
stride
=
self
.
_stride
,
padding
=
self
.
_padding
,
padding
=
self
.
_
updated_
padding
,
padding_algorithm
=
self
.
_padding_algorithm
,
padding_algorithm
=
self
.
_padding_algorithm
,
dilation
=
self
.
_dilation
,
dilation
=
self
.
_dilation
,
groups
=
self
.
_groups
,
groups
=
self
.
_groups
,
...
@@ -951,7 +950,7 @@ class Conv3D(_ConvNd):
...
@@ -951,7 +950,7 @@ class Conv3D(_ConvNd):
self
.
weight
,
self
.
weight
,
bias
=
self
.
bias
,
bias
=
self
.
bias
,
stride
=
self
.
_stride
,
stride
=
self
.
_stride
,
padding
=
self
.
_padding
,
padding
=
self
.
_
updated_
padding
,
padding_algorithm
=
self
.
_padding_algorithm
,
padding_algorithm
=
self
.
_padding_algorithm
,
dilation
=
self
.
_dilation
,
dilation
=
self
.
_dilation
,
groups
=
self
.
_groups
,
groups
=
self
.
_groups
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录