When slicing out of bounds of 1-D NDArray, an exception occurs correctly.
require 'mxnet'
a = MXNet::NDArray.ones([5])
a[0..7]
git/mxnet.rb/lib/mxnet/ndarray.rb:121:in '_slice' MXNet::Error (MXNetError: Check failed: shape_[0] >= end (5 vs. 8) : Slice end index out of range)
When slicing out of bounds of N-D NDArray, the OOB is ignored and as much as possible of the slice is returned.
require 'mxnet'
a = MXNet::NDArray.ones([5,5])
a[0, 0..7]
[1, 1, 1, 1, 1] <MXNet::NDArray 5 @cpu(0)>
require 'mxnet'
a = MXNet::NDArray.ones([5,5])
a[0..7, 2]
[1, 1, 1, 1, 1] <MXNet::NDArray 5 @cpu(0)>
Consistent error behaviour is expected between these methods.