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
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions tools/check_op_desc.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
from paddle.utils import OpLastCheckpointChecker
from paddle.fluid.core import OpUpdateType

SAME = 0

INPUTS = "Inputs"
OUTPUTS = "Outputs"
ATTRS = "Attrs"
Expand Down Expand Up @@ -71,7 +69,7 @@ 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 origin_vars.get(var_name) == new_vars.get(var_name):
continue
else:
error, var_error = True, True
Expand Down Expand Up @@ -120,7 +118,7 @@ def diff_attr(ori_attrs, new_attrs):
attrs_only_in_new = set(new_attrs.keys()) - set(ori_attrs.keys())

for attr_name in common_attrs:
if cmp(ori_attrs.get(attr_name), new_attrs.get(attr_name)) == SAME:
if ori_attrs.get(attr_name) == new_attrs.get(attr_name):
continue
else:
error, attr_error = True, True
Expand Down Expand Up @@ -184,7 +182,7 @@ def compare_op_desc(origin_op_desc, new_op_desc):
new = json.loads(new_op_desc)
desc_error_message = {}
version_error_message = {}
if cmp(origin_op_desc, new_op_desc) == SAME:
if origin_op_desc == new_op_desc:
return desc_error_message, version_error_message

for op_type in origin:
Expand Down