Skip to content

Conversation

@0x3878f
Copy link
Contributor

@0x3878f 0x3878f commented Jun 3, 2025

PR Category

Execute Infrastructure

PR Types

Improvements

Description

Improve dispatch for operator.is_
pcard-67164

@paddle-bot
Copy link

paddle-bot bot commented Jun 3, 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.

var.get_py_value() is other.get_py_value(),
@Dispatcher.register_decorator(operator.is_)
def is_func(var: VariableBase, other: VariableBase):
if var.get_py_type() != other.get_py_type():
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if var.get_py_type() != other.get_py_type():
if var.get_py_type() is not other.get_py_type():

这里可以改成 is not,不需要触发 __eq__ 的 dispatch,直接严格相同对象即可

Copy link
Contributor Author

Choose a reason for hiding this comment

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

好的

),
)


Copy link
Member

Choose a reason for hiding this comment

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

这行删一下吧

Copy link
Contributor Author

Choose a reason for hiding this comment

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

好的

Copy link
Member

@SigureMo SigureMo left a comment

Choose a reason for hiding this comment

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

LGTMeow 🐾

@SigureMo SigureMo merged commit 4877401 into PaddlePaddle:develop Jun 9, 2025
48 of 49 checks passed
shanjiang7 pushed a commit to shanjiang7/Paddle that referenced this pull request Jun 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants