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

extend toDoubleArray() method for scalars #5362

AlexDBlack opened this issue May 28, 2018 · 1 comment


Copy link

commented May 28, 2018

From @KolyaIvankov on May 28, 2018 11:13

In some cases, it is useful to be able to convert a scalar NDArray to a double array (albeit with a single value). For instance, a NN produces vectors of different length as output, and the length may well be 1, depending on the task. However, in the method toDoubleArray() it is first verified that the data is a vector, and when data is a scalar, an exception is thrown. It suffices to replace (!this.IsVector) with (!this.isScalarVector())' in line 2406 of BaseNDArray.class`: this will do no harm, an prevent exceptions to occur in the extreme case when length is 1.

Copied from original issue: deeplearning4j/nd4j#2914

@AlexDBlack AlexDBlack added this to the DL4J/Arbiter/DataVec Planning Sprint (01 June) milestone May 29, 2018

AlexDBlack added a commit that referenced this issue May 30, 2018

This comment has been minimized.

Copy link

commented Sep 21, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Sep 21, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
1 participant
You can’t perform that action at this time.