mseth10 commented on issue #14105: nd.slice errors out when end=-1 and step=-1 URL: https://github.com/apache/incubator-mxnet/issues/14105#issuecomment-473099903 Closing this issue as the behavior is consistent with numpy. Here is how we can get the element at 0-th index with MXNet NDArray. ``` >>> import mxnet.ndarray as nd >>> a = nd.normal(shape=(4)) >>> a [2.2122064 0.7740038 1.0434405 1.1839255] <NDArray 4 @cpu(0)> >>> nd.slice(a, begin=2, end=(None,), step=-1) [1.0434405 0.7740038 2.2122064] <NDArray 3 @cpu(0)> ``` Note: `None` needs to be given as part of a tuple.
---------------------------------------------------------------- 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
