You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/08/23 18:43:07 UTC
[GitHub] sandeep-krishnamurthy closed pull request #12295: [MXNET-696]
Define cmp() in Python 3 again
sandeep-krishnamurthy closed pull request #12295: [MXNET-696] Define cmp() in Python 3 again
URL: https://github.com/apache/incubator-mxnet/pull/12295
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..d8ffca25a3f 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:
users@infra.apache.org
With regards,
Apache Git Services