Skip to content

Conversation

@zhangyuqin1998
Copy link
Contributor

PR types

Bug fixes

PR changes

Others

Description

PaddlePaddle/Paddle#68850 的修改导致动转静时,转出来的函数类名称可能变为WeakMethod,因此需要在 adapt_stale_fwd_patch 这个方法里做对应的适配。

@paddle-bot
Copy link

paddle-bot bot commented Nov 5, 2024

Thanks for your contribution!

):
return value
if type(value).__name__.endswith("WeakMethod") or self.forward.__class__.__name__.endswith("WeakMethod"):
return value
Copy link
Contributor

Choose a reason for hiding this comment

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

对于比较老的paddle版本,这里的修改看起来不兼容?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

对于比较老的paddle版本,这里的修改看起来不兼容?

动转静时,老版本的函数类名叫做 StaticFunction,新版本更新后,这个名字可能是[StaticFunction,WeakMethod]之一。这里的修改其实是兼容老版本的。

Copy link
Contributor

@wawltor wawltor left a comment

Choose a reason for hiding this comment

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

LGTM

@wawltor wawltor merged commit 19a2e1f into PaddlePaddle:develop Nov 6, 2024
9 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants