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

Conversation

@karllessard
Copy link
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).

Copy link
Contributor

@CraigacpCraigacp 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.


importjava.util.stream.DoubleStream;
importjava.util.stream.IntStream;
importjava.util.stream.LongStream;
Copy link
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.


importjava.util.function.BiConsumer;
importjava.util.function.Consumer;
importjava.util.stream.DoubleStream;
Copy link
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
Contributor

@CraigacpCraigacp left a comment

Choose a reason for hiding this comment

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

LGTM

@karllessardkarllessard merged commit a9d3f25 into tensorflow:mainJan 25, 2023
@karllessardkarllessard deleted the value-streaming branch January 25, 2023 18:25
Sign up for freeto 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

@karllessard@Craigacp