Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
X2Paddle
提交
80f23a85
X
X2Paddle
项目概览
PaddlePaddle
/
X2Paddle
大约 1 年 前同步成功
通知
328
Star
698
Fork
167
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
26
列表
看板
标记
里程碑
合并请求
4
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
X2Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
26
Issue
26
列表
看板
标记
里程碑
合并请求
4
合并请求
4
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
80f23a85
编写于
8月 25, 2021
作者:
W
WJJ1995
提交者:
GitHub
8月 25, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fixed MaxUnpool bug (#662)
上级
90fdab16
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
6 addition
and
10 deletion
+6
-10
docs/pytorch_project_convertor/API_docs/nn/torch.nn.MaxUnpool1d.md
...rch_project_convertor/API_docs/nn/torch.nn.MaxUnpool1d.md
+2
-3
docs/pytorch_project_convertor/API_docs/nn/torch.nn.MaxUnpool2d.md
...rch_project_convertor/API_docs/nn/torch.nn.MaxUnpool2d.md
+2
-4
docs/pytorch_project_convertor/API_docs/nn/torch.nn.MaxUnpool3d.md
...rch_project_convertor/API_docs/nn/torch.nn.MaxUnpool3d.md
+2
-3
未找到文件。
docs/pytorch_project_convertor/API_docs/nn/torch.nn.MaxUnpool1d.md
浏览文件 @
80f23a85
...
...
@@ -8,10 +8,9 @@ torch.nn.MaxUnpool1d(kernel_size, stride=None, padding=0)
```
python
import
paddle
import
paddle.nn
as
nn
TYPE_MAPPER
=
{
"fp16"
:
"float16"
,
"fp32"
:
"float32"
,
"fp64"
:
"float64"
}
# 定义MaxUnpool1D
class
MaxUnpool1D
(
paddle
.
nn
.
Layer
):
class
MaxUnpool1D
(
nn
.
Layer
):
def
__init__
(
self
,
kernel_size
,
stride
=
None
,
padding
=
0
):
super
().
__init__
()
if
isinstance
(
stride
,
int
):
...
...
@@ -49,7 +48,7 @@ class MaxUnpool1D(paddle.nn.Layer):
flatten_indices
=
paddle
.
flatten
(
indices
)
flatten_input
=
paddle
.
flatten
(
input
)
for
i
in
range
(
flatten_indices
.
shape
[
0
]):
flatten_out
[
flatten_indices
[
i
].
tolist
()]
=
flatten_input
[
i
].
tolist
()
flatten_out
[
int
(
flatten_indices
[
i
])]
=
flatten_input
[
i
]
out
=
paddle
.
reshape
(
flatten_out
,
out
.
shape
)
return
out
...
...
docs/pytorch_project_convertor/API_docs/nn/torch.nn.MaxUnpool2d.md
浏览文件 @
80f23a85
...
...
@@ -9,10 +9,9 @@ torch.nn.MaxUnpool2d(kernel_size, stride=None, padding=0)
```
python
import
paddle
import
paddle.nn
as
nn
TYPE_MAPPER
=
{
"fp16"
:
"float16"
,
"fp32"
:
"float32"
,
"fp64"
:
"float64"
}
# 定义MaxUnpool2D
class
MaxUnpool2D
(
paddle
.
nn
.
Layer
):
class
MaxUnpool2D
(
nn
.
Layer
):
def
__init__
(
self
,
kernel_size
,
stride
=
None
,
padding
=
0
):
super
().
__init__
()
if
isinstance
(
stride
,
int
):
...
...
@@ -41,7 +40,6 @@ class MaxUnpool2D(paddle.nn.Layer):
if
len
(
output_size
)
==
len
(
self
.
kernel_size
)
+
2
:
output_size
=
output_size
[
2
:]
t
=
str
(
input
.
dtype
).
lower
().
strip
().
split
(
"."
)[
-
1
]
t
=
TYPE_MAPPER
[
t
]
out
=
paddle
.
zeros
(
output_size
,
dtype
=
t
)
flatten_out
=
paddle
.
flatten
(
out
)
for
i
in
range
(
indices
.
shape
[
0
]):
...
...
@@ -53,7 +51,7 @@ class MaxUnpool2D(paddle.nn.Layer):
flatten_indices
=
paddle
.
flatten
(
indices
)
flatten_input
=
paddle
.
flatten
(
input
)
for
i
in
range
(
flatten_indices
.
shape
[
0
]):
flatten_out
[
flatten_indices
[
i
].
tolist
()]
=
flatten_input
[
i
].
tolist
()
flatten_out
[
int
(
flatten_indices
[
i
])]
=
flatten_input
[
i
]
out
=
paddle
.
reshape
(
flatten_out
,
out
.
shape
)
return
out
...
...
docs/pytorch_project_convertor/API_docs/nn/torch.nn.MaxUnpool3d.md
浏览文件 @
80f23a85
...
...
@@ -8,10 +8,9 @@ torch.nn.MaxUnpool3d(kernel_size, stride=None, padding=0)
```
python
import
paddle
import
paddle.nn
as
nn
TYPE_MAPPER
=
{
"fp16"
:
"float16"
,
"fp32"
:
"float32"
,
"fp64"
:
"float64"
}
# 定义MaxUnpool3D
class
MaxUnpool3D
(
paddle
.
nn
.
Layer
):
class
MaxUnpool3D
(
nn
.
Layer
):
def
__init__
(
self
,
kernel_size
,
stride
=
None
,
padding
=
0
):
super
().
__init__
()
if
isinstance
(
stride
,
int
):
...
...
@@ -55,7 +54,7 @@ class MaxUnpool3D(paddle.nn.Layer):
flatten_indices
=
paddle
.
flatten
(
indices
)
flatten_input
=
paddle
.
flatten
(
input
)
for
i
in
range
(
flatten_indices
.
shape
[
0
]):
flatten_out
[
flatten_indices
[
i
].
tolist
()]
=
flatten_input
[
i
].
tolist
()
flatten_out
[
int
(
flatten_indices
[
i
])]
=
flatten_input
[
i
]
out
=
paddle
.
reshape
(
flatten_out
,
out
.
shape
)
return
out
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录