Skip to content

Commit 89d01e9

Browse files
anijain2305facebook-github-bot
authored andcommitted
Use polyfill to implement comparison operators (#144485)
Summary: X-link: pytorch/pytorch#144485 Approved by: https://github.com/jansel Reviewed By: atalman Differential Revision: D69256620 fbshipit-source-id: 51719153d0488f44e4fd3555d43f661161173f76
1 parent a22a2a8 commit 89d01e9

File tree

1 file changed

+10
-0
lines changed
  • userbenchmark/dynamo/dynamobench/_dynamo

1 file changed

+10
-0
lines changed

userbenchmark/dynamo/dynamobench/_dynamo/utils.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,6 +1008,16 @@ def is_function(value):
10081008
)
10091009

10101010

1011+
cmp_name_to_op_mapping = {
1012+
"__eq__": operator.eq,
1013+
"__ne__": operator.ne,
1014+
"__lt__": operator.lt,
1015+
"__le__": operator.le,
1016+
"__gt__": operator.gt,
1017+
"__ge__": operator.ge,
1018+
}
1019+
1020+
10111021
def is_wrapper_or_member_descriptor(value):
10121022
return isinstance(
10131023
value,

0 commit comments

Comments
 (0)