-
Notifications
You must be signed in to change notification settings - Fork 5.9k
[API-Compat] Add paddle.compat.Unfold that supports tensor inputs. #74572
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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
|
/re-run all failed |
1 similar comment
|
/re-run all failed |
f79c073 to
8cddbad
Compare
|
/re-run all-failed |
1 similar comment
|
/re-run all-failed |
8cddbad to
1022193
Compare
|
/re-run all-failed |
XiaoguangHu01
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
| @@ -0,0 +1,121 @@ | |||
| # Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| # 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code-block 下需要空一行
| >>> unfold = paddle.compat.Unfold(kernel_size=[3, 3]) | ||
| >>> result = unfold(x) | ||
| >>> print(result.shape) | ||
| [100, 27, 49284] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SigureMo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
可以先合入,但后续英文文档和中文文档要一起让 @sunzhongkai588 review 下
…addlePaddle#74572) * [API-Compat] Add paddle.compat.Unfold that supports tensor inputs. * [API-Compat] Fixed pre-commit problem * [API-Compat] Fixed merging precomit failure
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