diff --git a/paddle/phi/api/yaml/legacy_backward.yaml b/paddle/phi/api/yaml/legacy_backward.yaml index a19b54be724252955506ae9d87b61e7e1eefc08a..fe8c37940665e85c370273f6292825e7bfdfa276 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 0aa0a8420831acd7080dfe40ed7d2685bafc284d..fc0b02d7a68461788393481eb0aec8e7e27d732a 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,