sandeep-krishnamurthy closed pull request #12191: [MXNET-696] Define cmp() in Python 3 for line 222 URL: https://github.com/apache/incubator-mxnet/pull/12191
This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/tests/nightly/model_backwards_compatibility_check/common.py b/tests/nightly/model_backwards_compatibility_check/common.py index 8950a927083..c41b11faf08 100644 --- a/tests/nightly/model_backwards_compatibility_check/common.py +++ b/tests/nightly/model_backwards_compatibility_check/common.py @@ -29,6 +29,13 @@ import re from mxnet.test_utils import assert_almost_equal +try: + cmp # Python 2 +except NameError: + # See: https://docs.python.org/3.0/whatsnew/3.0.html#ordering-comparisons + def cmp(x, y): # Python 3 + return (x > y) - (x < y) + # Set fixed random seeds. mx.random.seed(7) np.random.seed(7) ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
