Skip to content
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
Craigacp:to-strings
Mar 17, 2022
Merged

Adding toString to AbstractDenseNdArray and AbstractSparseNdArray#8
karllessard merged 3 commits intotensorflow:mainfrom
Craigacp:to-strings

Conversation

@Craigacp
Copy link
Contributor

This adds a simple toString to AbstractDenseNdArray and AbstractSparseNdArray which 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. DenseNdArray doesn't display its type, but SparseNdArray does. All the other concrete classes have their type in their name so it's redundant for them and they just display the class name. For DenseNdArray I 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.

@Craigacp Craigacp requested a review from karllessard March 13, 2022 02:28
@karllessard karllessard merged commit 51ac2c0 into tensorflow:main Mar 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants