[API-Compat] Add paddle.compat.Unfold that supports tensor inputs.#74572
Merged
zhangbo9674 merged 3 commits intoPaddlePaddle:developfrom Aug 19, 2025
Merged
[API-Compat] Add paddle.compat.Unfold that supports tensor inputs.#74572zhangbo9674 merged 3 commits intoPaddlePaddle:developfrom
zhangbo9674 merged 3 commits intoPaddlePaddle:developfrom
Conversation
|
你的PR提交成功,感谢你对开源项目的贡献! |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #74572 +/- ##
==========================================
Coverage ? 95.83%
==========================================
Files ? 3
Lines ? 24
Branches ? 0
==========================================
Hits ? 23
Misses ? 1
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
e37c894 to
d9e8179
Compare
Contributor
Author
|
/re-run all failed |
1 similar comment
Contributor
Author
|
/re-run all failed |
f79c073 to
8cddbad
Compare
Contributor
Author
|
/re-run all-failed |
1 similar comment
Contributor
Author
|
/re-run all-failed |
8cddbad to
1022193
Compare
Contributor
Author
|
/re-run all-failed |
zhangbo9674
approved these changes
Aug 19, 2025
SigureMo
reviewed
Aug 19, 2025
| @@ -0,0 +1,121 @@ | |||
| # Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved. | |||
Member
There was a problem hiding this comment.
Suggested change
| # Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved. | |
| # Copyright (c) 2025 PaddlePaddle Authors. All Rights Reserved. |
| For default, it will be [1, 1]. | ||
| Examples: | ||
| .. code-block:: python | ||
| >>> import paddle |
| >>> unfold = paddle.compat.Unfold(kernel_size=[3, 3]) | ||
| >>> result = unfold(x) | ||
| >>> print(result.shape) | ||
| [100, 27, 49284] |
Member
There was a problem hiding this comment.
SigureMo
approved these changes
Aug 19, 2025
Member
SigureMo
left a comment
There was a problem hiding this comment.
可以先合入,但后续英文文档和中文文档要一起让 @sunzhongkai588 review 下
This was referenced Aug 19, 2025
Luckycheng222
pushed a commit
to Luckycheng222/Paddle
that referenced
this pull request
Aug 25, 2025
…addlePaddle#74572) * [API-Compat] Add paddle.compat.Unfold that supports tensor inputs. * [API-Compat] Fixed pre-commit problem * [API-Compat] Fixed merging precomit failure
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Category
Operator Mechanism
PR Types
New features
Description
增加了
paddle.compat.Unfold。原始的paddle.nn.Unfold与PyTorch 中的nn.Unfold操作主要有两点不同:compat.Unfold因此也限制了用户输入 Size4 padding(会报错提示用户使用nn.Unfold)tolist()方法无法使用,故不做 C++ 端处理可能(目前没有发现好的方法)无法正确转换输入。test_compat_unfold.pyPcard-89620