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/07/04 22:20:51 UTC
[GitHub] leezu commented on issue #11550: NDarray should support __setitem__
with empty key, value
leezu commented on issue #11550: NDarray should support __setitem__ with empty key, value
URL: https://github.com/apache/incubator-mxnet/issues/11550#issuecomment-402566523
At least `mx.nd.array([])` doesn't raise an error. Also indexing an array to obtain an empty one works. My impression was that NDarray aims to model np.ndarray as close as feasible?
Regarding use-case, consider having a list of 1D ndarrays of varying length, with some being empty. Padding them to the same length (and creating a 2D array) following the code above will raise the issue. If mxnet matches the numpy behavior code can be simplified. Otherwise an extra if, else statement needs to be added to handle the special case of empty arrays.
----------------------------------------------------------------
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