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 2017/11/02 17:08:21 UTC

[GitHub] szha commented on a change in pull request #8476: add default hash to ndarray

szha commented on a change in pull request #8476: add default hash to ndarray
URL: https://github.com/apache/incubator-mxnet/pull/8476#discussion_r148598477
 
 

 ##########
 File path: python/mxnet/ndarray/ndarray.py
 ##########
 @@ -286,6 +286,10 @@ def __eq__(self, other):
         """x.__eq__(y) <=> x==y <=> mx.nd.equal(x, y) """
         return equal(self, other)
 
+    def __hash__(self):
+        """Default hash function."""
+        return id(self)//16
 
 Review comment:
   @larroy why does it matter?

----------------------------------------------------------------
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