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

Nd4j: Change array args to vararg and add toString options #36

Merged
merged 14 commits into from Jul 2, 2019

Conversation

@rnett
Copy link
Collaborator

commented Jun 28, 2019

Fixes eclipse#7950.

rnett added 4 commits Jun 28, 2019
changed [] to ...
Signed-off-by: Ryan Nett <rnett@skymind.io>
added randn(long seed, int... shape)
Signed-off-by: Ryan Nett <rnett@skymind.io>
Fixed a couple of methods
Signed-off-by: Ryan Nett <rnett@skymind.io>
ToString methods w/ options
Signed-off-by: Ryan Nett <rnett@skymind.io>

@rnett rnett changed the title Nd4j: Change array args to vararg Nd4j: Change array args to vararg and add toString options Jun 28, 2019

@rnett

This comment has been minimized.

Copy link
Collaborator Author

commented Jun 28, 2019

Added fix for eclipse#7951

The way things are implemented, maxElements isn't a cutoff, but forces a summary if over the limit.

@rnett rnett requested a review from AlexDBlack Jun 29, 2019

@AlexDBlack
Copy link

left a comment

See comments

INDArray ret = Nd4j.createUninitialized(shape, order());
return randn(ret);
}

public static INDArray randn(DataType dataType, int... shape) {

This comment has been minimized.

Copy link
@AlexDBlack

AlexDBlack Jun 29, 2019

Don't add new int... methods - use long... instead. Things like Nd4j.randn(DataType.FLOAT, 1,2,3) will resolve to the long... signature if no int... signature is available.

Also all new methods should have at least basic javadoc

This comment has been minimized.

Copy link
@rnett

rnett Jun 29, 2019

Author Collaborator

I used int in case someone was calling it with new int[]{...}, although yeah, its not needed for the new ones.

rnett added 6 commits Jun 29, 2019
fixes, less toString methods, and a few ops I missed
Signed-off-by: Ryan Nett <rnett@skymind.io>
some javadocs, change int... to long... where possible
Signed-off-by: Ryan Nett <rnett@skymind.io>
another javadoc
Signed-off-by: Ryan Nett <rnett@skymind.io>
javadoc fix
Signed-off-by: Ryan Nett <rnett@skymind.io>
just javadoc in INDArray
Signed-off-by: Ryan Nett <rnett@skymind.io>
local/static fix
Signed-off-by: Ryan Nett <rnett@skymind.io>
@AlexDBlack
Copy link

left a comment

Looks good, just some additional minor polish required.

rnett added 4 commits Jul 1, 2019
Add @nonnull to options
Signed-off-by: Ryan Nett <rnett@skymind.io>
javadoc updates/fixes
Signed-off-by: Ryan Nett <rnett@skymind.io>
more @NonNulls
Signed-off-by: Ryan Nett <rnett@skymind.io>
even more @NonNulls, this time on varargs
Signed-off-by: Ryan Nett <rnett@skymind.io>

@rnett rnett requested a review from AlexDBlack Jul 1, 2019

@rnett

This comment has been minimized.

Copy link
Collaborator Author

commented Jul 1, 2019

Fairly sure this is good to merge, I stuck @NonNull on all of the varargs I added and some I didn't.

@AlexDBlack
Copy link

left a comment

LGTM 👍

@AlexDBlack AlexDBlack merged commit 06d63a8 into master Jul 2, 2019

@rnett rnett deleted the rn_nd4j_varargs branch Jul 2, 2019

AlexDBlack added a commit that referenced this pull request Jul 20, 2019
Nd4j: Change array args to vararg and add toString options (#36)
* changed [] to ...

Signed-off-by: Ryan Nett <rnett@skymind.io>

* added randn(long seed, int... shape)

Signed-off-by: Ryan Nett <rnett@skymind.io>

* Fixed a couple of methods

Signed-off-by: Ryan Nett <rnett@skymind.io>

* ToString methods w/ options

Signed-off-by: Ryan Nett <rnett@skymind.io>

* fixes, less toString methods, and a few ops I missed

Signed-off-by: Ryan Nett <rnett@skymind.io>

* some javadocs, change int... to long... where possible

Signed-off-by: Ryan Nett <rnett@skymind.io>

* another javadoc

Signed-off-by: Ryan Nett <rnett@skymind.io>

* javadoc fix

Signed-off-by: Ryan Nett <rnett@skymind.io>

* just javadoc in INDArray

Signed-off-by: Ryan Nett <rnett@skymind.io>

* local/static fix

Signed-off-by: Ryan Nett <rnett@skymind.io>

* Add @nonnull to options

Signed-off-by: Ryan Nett <rnett@skymind.io>

* javadoc updates/fixes

Signed-off-by: Ryan Nett <rnett@skymind.io>

* more @NonNulls

Signed-off-by: Ryan Nett <rnett@skymind.io>

* even more @NonNulls, this time on varargs

Signed-off-by: Ryan Nett <rnett@skymind.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.