reminisce commented on a change in pull request #17452: Fix indexing with zero
dim array
URL: https://github.com/apache/incubator-mxnet/pull/17452#discussion_r372560287
##########
File path: python/mxnet/ndarray/ndarray.py
##########
@@ -3055,6 +3060,8 @@ def get_indexing_dispatch_code(key):
return _NDARRAY_EMPTY_TUPLE_INDEXING
if getattr(idx, 'dtype', None) == np.bool_:
num_bools += 1
+ if getattr(idx, 'ndim', None) == 0: # zero-dim array as index
treated as integer
Review comment:
@sxjscience You are right. I thought it's not supported before. The error
message reported by @mli is actually about misuse of float numbers as integers
which is consistent with NumPy's behavior. I will remove the code in ndarray
while keeping the test cases in the PR.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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