[API Compatibility] add torch.nn.ParameterDict -part#831
Open
Manfredss wants to merge 2 commits intoPaddlePaddle:masterfrom
Open
[API Compatibility] add torch.nn.ParameterDict -part#831Manfredss wants to merge 2 commits intoPaddlePaddle:masterfrom
Manfredss wants to merge 2 commits intoPaddlePaddle:masterfrom
Conversation
|
Thanks for your contribution! |
zhwesky2010
reviewed
Feb 28, 2026
| 'a': nn.Parameter(torch.ones(2, 3)), | ||
| 'b': nn.Parameter(torch.zeros(4)), | ||
| }) | ||
| result = choices.pop('a') |
Collaborator
There was a problem hiding this comment.
torch支持的话,这个也应该支持下,改paddle吧
tests/test_nn_ParameterDict.py
Outdated
|
|
||
|
|
||
| # Paddle ParameterDict does not support pop() method | ||
| def _test_case_13(): |
Collaborator
There was a problem hiding this comment.
还有一个测试是否没加:
输入为另一个ParameterDict的情况
zhwesky2010
reviewed
Mar 3, 2026
| result = choices['a'] | ||
| """ | ||
| ) | ||
| obj.run(pytorch_code, ["result"], check_stop_gradient=False) |
Collaborator
There was a problem hiding this comment.
check_stop_gradient 这个关闭的原因是?
Collaborator
|
ParameterDict.pop目前跑不过,这个再提一个paddle PR吧。后续可以本地先测paconvert,确保对齐后再合paddle。 |
Contributor
Author
我已经重提过 pr 了 |
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 Docs
add torch.nn.ParameterDict
PR APIs
related paddle pr: