Skip to content

Conversation

Qin-sx
Copy link
Contributor

@Qin-sx Qin-sx commented Jun 19, 2025

PR Category

User Experience

PR Types

Improvements

Description

当前问题
train/eval无返回值,导致paddle不支持model.eval()(input)、model.eval().set_state_dict(state_dict)之类的写法,写法不够灵活,限制了写法,

解决方案
在Module.train和Module.eval函数中加入了返回值,支持与竞品相同的写法,写法更灵活。

	modified:   python/paddle/nn/layer/layers.py
Copy link

paddle-bot bot commented Jun 19, 2025

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@paddle-bot paddle-bot bot added the contributor External developers label Jun 19, 2025
Copy link
Contributor

@zhwesky2010 zhwesky2010 left a comment

Choose a reason for hiding this comment

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

LGTM

@luotao1 luotao1 merged commit e22b1a5 into PaddlePaddle:develop Jun 20, 2025
48 of 52 checks passed
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.

4 participants