Invoking MXNet::NDArray.new constructs an invalid instance. Specifically, ndarray_allocate() is called but a handle is never allocated, so future calls to mxnet_ndarray_get_handle() return NULL which breaks code that doesn't deal with this case (specifically in my case the Ruby executable crashes when I try to do anything with this instance).
There isn't any obvious use case for MXNet::NDArray.new and the Python API doesn't have an equivalent, so simply redefine it to raise an error.
Invoking
MXNet::NDArray.new
constructs an invalid instance. Specifically,ndarray_allocate()
is called but a handle is never allocated, so future calls tomxnet_ndarray_get_handle()
returnNULL
which breaks code that doesn't deal with this case (specifically in my case the Ruby executable crashes when I try to do anything with this instance).There isn't any obvious use case for
MXNet::NDArray.new
and the Python API doesn't have an equivalent, so simply redefine it to raise an error.