Incorrect predicate application in EagerTestSession and GraphTestSession
Open
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 928
- Forks
- 227
- PR merge metrics
- No merged PRs in 30d
Description
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?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Search the EagerTestSession and GraphTestSession classes for assertions matching the shown forEachIndexed pattern. Check whether each predicate is applied to the iterated scalar rather than the tensor's default element, then verify that all affected assertions use the intended value.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100