From 45a9115880e5681c98ed5cef9eedcb2307c23080 Mon Sep 17 00:00:00 2001 From: Weilong Wu Date: Tue, 30 Aug 2022 19:04:40 +0800 Subject: [PATCH] [Eager] fix unpool and yaml config (#45544) --- paddle/phi/api/yaml/legacy_backward.yaml | 2 -- python/paddle/nn/functional/pooling.py | 3 ++- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/paddle/phi/api/yaml/legacy_backward.yaml b/paddle/phi/api/yaml/legacy_backward.yaml index a19b54be724..fe8c3794066 100755 --- a/paddle/phi/api/yaml/legacy_backward.yaml +++ b/paddle/phi/api/yaml/legacy_backward.yaml @@ -2715,7 +2715,6 @@ kernel: func: unpool3d_grad data_type: x - no_need_buffer : x - backward_api: unpool_grad forward: unpool (Tensor x, Tensor indices, int[] ksize, int[] strides, int[] padding, int[] output_size, str data_format) -> Tensor(out) @@ -2727,4 +2726,3 @@ kernel: func: unpool_grad data_type: x - no_need_buffer : x diff --git a/python/paddle/nn/functional/pooling.py b/python/paddle/nn/functional/pooling.py index 0aa0a842083..fc0b02d7a68 100755 --- a/python/paddle/nn/functional/pooling.py +++ b/python/paddle/nn/functional/pooling.py @@ -878,7 +878,7 @@ def max_unpool2d(x, if in_dygraph_mode(): output = _C_ops.unpool(x, indices, kernel_size, stride, padding, output_size, data_format) - + return output elif in_dynamic_mode(): output = _legacy_C_ops.unpool(x, indices, 'unpooling_type', 'max', 'ksize', kernel_size, 'strides', stride, @@ -995,6 +995,7 @@ def max_unpool3d(x, if in_dygraph_mode(): output = _C_ops.unpool3d(x, indices, kernel_size, stride, padding, output_size, data_format) + return output elif in_dynamic_mode(): output = _legacy_C_ops.unpool3d(x, indices, 'unpooling_type', 'max', 'ksize', kernel_size, 'strides', stride, -- GitLab