Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chang check_op_desc.py to py3 #32825

Merged
merged 4 commits into from
May 12, 2021
Merged

chang check_op_desc.py to py3 #32825

merged 4 commits into from
May 12, 2021

Conversation

tianshuo78520a
Copy link
Contributor

@tianshuo78520a tianshuo78520a commented May 10, 2021

PR types

Others

PR changes

Others

Describe

在本地使用新的check_op_desc.py脚本做了测试
image

@paddle-bot-old
Copy link

Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

Copy link
Contributor

@wadefelix wadefelix left a comment

Choose a reason for hiding this comment

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

如批注

@@ -71,7 +72,8 @@ def diff_vars(origin_vars, new_vars):
vars_name_only_in_new = set(new_vars.keys()) - set(origin_vars.keys())

for var_name in common_vars_name:
if cmp(origin_vars.get(var_name), new_vars.get(var_name)) == SAME:
if operator.eq(origin_vars.get(var_name),
Copy link
Contributor

Choose a reason for hiding this comment

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

不要与SAME比较了。
直接使用eq的布尔值结果。
这个var_name 看着就想是字符串, 何不直接origin_vars.get(var_name) == new_vars.get(var_name)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

直接用布尔值做if,连==都可以省略,觉得如何?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@liym27 觉得如何?

Copy link
Contributor

@liym27 liym27 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 cefc063 into PaddlePaddle:develop May 12, 2021
@luotao1 luotao1 changed the title Cpu py3 chang check_op_desc.py to py3 May 12, 2021
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.

4 participants