This repository was archived by the owner on Jul 15, 2025. It is now read-only.
Adding toString to AbstractDenseNdArray and AbstractSparseNdArray#8
Merged
karllessard merged 3 commits intotensorflow:mainfrom Mar 17, 2022
Merged
Adding toString to AbstractDenseNdArray and AbstractSparseNdArray#8karllessard merged 3 commits intotensorflow:mainfrom
karllessard merged 3 commits intotensorflow:mainfrom
Conversation
karllessard
reviewed
Mar 16, 2022
ndarray/src/main/java/org/tensorflow/ndarray/impl/sparse/SparseNdArray.java
Outdated
Show resolved
Hide resolved
ndarray/src/test/java/org/tensorflow/ndarray/impl/sparse/DoubleSparseNdArrayTest.java
Outdated
Show resolved
Hide resolved
karllessard
reviewed
Mar 16, 2022
ndarray/src/main/java/org/tensorflow/ndarray/impl/sparse/AbstractSparseNdArray.java
Outdated
Show resolved
Hide resolved
karllessard
reviewed
Mar 16, 2022
ndarray/src/main/java/org/tensorflow/ndarray/impl/sparse/AbstractSparseNdArray.java
Show resolved
Hide resolved
karllessard
approved these changes
Mar 17, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds a simple toString to
AbstractDenseNdArrayandAbstractSparseNdArraywhich pulls in the concrete class name. The dense one includes the shape, the sparse one includes the default value, the number of non-sparse elements and the dense shape.DenseNdArraydoesn't display its type, butSparseNdArraydoes. All the other concrete classes have their type in their name so it's redundant for them and they just display the class name. ForDenseNdArrayI wasn't sure if it was possible to create a completely empty ndarray and so I'm not quite sure how to get the type.I added a few small tests, I can roll them out to all the instances if you think it's necessary.