Skip to content
This repository was archived by the owner on Jul 15, 2025. It is now read-only.

Value streaming for NdArrays#15

Merged
karllessard merged 2 commits intotensorflow:mainfrom
karllessard:value-streaming
Jan 25, 2023
Merged

Value streaming for NdArrays#15
karllessard merged 2 commits intotensorflow:mainfrom
karllessard:value-streaming

Conversation

@karllessard
Copy link
Copy Markdown
Contributor

Adds basic methods allowing users to visit all scalar values of a NdArray using Java Streams.

Array of all types can retrieve their values as a stream of objects, while arrays of Int, Long or Double can also stream of primitive values (which is preferred).

@karllessard karllessard requested a review from Craigacp January 25, 2023 16:27
Copy link
Copy Markdown
Contributor

@Craigacp Craigacp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The lack of FloatStream in the JDK is annoying as that's the one we'd use the most, but we can't fix that.


import java.util.stream.DoubleStream;
import java.util.stream.IntStream;
import java.util.stream.LongStream;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some redundant imports here.


import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.stream.DoubleStream;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant import?

Copy link
Copy Markdown
Contributor

@Craigacp Craigacp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@karllessard karllessard merged commit a9d3f25 into tensorflow:main Jan 25, 2023
@karllessard karllessard deleted the value-streaming branch January 25, 2023 18:25
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