Skip to content

Incorrect predicate application in EagerTestSession and GraphTestSession #223

@deansher

Description

@deansher

I believe this is a widespread broken pattern in EagerTestSession and GraphTestSession:

        o.asTensor()
            .scalars()
            .forEachIndexed((idx, f) -> assertTrue(predicate.test(o.asTensor().getFloat())));

Notice that f is ignored in the lambda, and o is referenced directly instead. getFloat then returns the zero'th element of the tensor.

@JimClarke5, am I right here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions