Skip to content

Commit

Permalink
Use polyfill to implement comparison operators (#144485)
Browse files Browse the repository at this point in the history
Summary:
X-link: pytorch/pytorch#144485
Approved by: https://github.com/jansel

Reviewed By: atalman

Differential Revision: D69256620

fbshipit-source-id: 51719153d0488f44e4fd3555d43f661161173f76
  • Loading branch information
anijain2305 authored and facebook-github-bot committed Feb 7, 2025
1 parent a22a2a8 commit 89d01e9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions userbenchmark/dynamo/dynamobench/_dynamo/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1008,6 +1008,16 @@ def is_function(value):
)


cmp_name_to_op_mapping = {
"__eq__": operator.eq,
"__ne__": operator.ne,
"__lt__": operator.lt,
"__le__": operator.le,
"__gt__": operator.gt,
"__ge__": operator.ge,
}


def is_wrapper_or_member_descriptor(value):
return isinstance(
value,
Expand Down

0 comments on commit 89d01e9

Please sign in to comment.