Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redefine .new to Raise an Error #26

Closed
wants to merge 1 commit into from

Conversation

toddsundsted
Copy link
Contributor

@toddsundsted toddsundsted commented Jun 23, 2018

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 to `mxnet_ndarray_get_handle()`
return `NULL` which breaks code that doesn't deal with this case.

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.
@mrkn
Copy link
Owner

mrkn commented Jun 27, 2018

Thank you for reporting the issue and proposing changes for fixing it.

I resolved it by the different way.

@toddsundsted
Copy link
Contributor Author

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants