Skip to content

[API Compatibility] add torch.nn.ParameterDict -part#831

Open
Manfredss wants to merge 2 commits intoPaddlePaddle:masterfrom
Manfredss:ApiEnhance_parameterdict
Open

[API Compatibility] add torch.nn.ParameterDict -part#831
Manfredss wants to merge 2 commits intoPaddlePaddle:masterfrom
Manfredss:ApiEnhance_parameterdict

Conversation

@Manfredss
Copy link
Contributor

PR Docs

add torch.nn.ParameterDict

PR APIs

torch.nn.ParameterDict

related paddle pr:

@paddle-bot
Copy link

paddle-bot bot commented Feb 20, 2026

Thanks for your contribution!

@paddle-bot paddle-bot bot added the contributor External developers label Feb 20, 2026
'a': nn.Parameter(torch.ones(2, 3)),
'b': nn.Parameter(torch.zeros(4)),
})
result = choices.pop('a')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

torch支持的话,这个也应该支持下,改paddle吧



# Paddle ParameterDict does not support pop() method
def _test_case_13():
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

还有一个测试是否没加:

输入为另一个ParameterDict的情况

@PaddlePaddle PaddlePaddle locked and limited conversation to collaborators Mar 2, 2026
@PaddlePaddle PaddlePaddle unlocked this conversation Mar 2, 2026
result = choices['a']
"""
)
obj.run(pytorch_code, ["result"], check_stop_gradient=False)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check_stop_gradient 这个关闭的原因是?

@zhwesky2010
Copy link
Collaborator

zhwesky2010 commented Mar 3, 2026

ParameterDict.pop目前跑不过,这个再提一个paddle PR吧。后续可以本地先测paconvert,确保对齐后再合paddle。

@Manfredss
Copy link
Contributor Author

ParameterDict.pop目前跑不过,这个再提一个paddle PR吧。后续可以本地先测paconvert,确保对齐后再合paddle。

我已经重提过 pr 了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor External developers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants