-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Add support for overloading comparison operations in relay (#2910) #3168
Conversation
Looks good, could you add some tests cases to ensure it is working as intended? |
Thanks for the feedback . I've had a look and tried to add some testcases and there was something that puzzled me and I don't fully understand. I would have expected a testcase like this to pass. from tvm import relay c = (a == b) But it fails with an assertion error because c evaluates to False statically. while c = (a < b) passes. Is this kind of discrepancy expected ? |
We don't overload equality because it interacts with Python's collections is ways which are not desirable. You should just test the comparisons you added. We can add an english method for checking equality if we want. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM please add a few testcases
ping @u99127 |
This commit adds support for overloaded comparison operators in the python binding for relay. Add a testcase for this
@tqchen - sorry I've been a bit busy recently. I've now pushed in my updates with the tests. |
This commit adds support for overloaded comparison operators in the python binding for relay. I'm not sure how best to add testcases for this and couldn't find any obvious examples. A simple python script that uses all the comparison operators as in the issue #2910 report works just fine.
This is my first contribution to tvm, so all suggestions are welcome.