tensorflow / tensorflow/java

NnOps topK not allowing variadic args for TopK.Options

Open
#615 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
928
Forks
227
PR merge metrics
No merged PRs in 30d

Description

Please make sure that this is a bug. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:bug_template

Describe the current behavior
In talking with @karllessard, we saw https://github.com/tensorflow/java/blob/e9c854fba1e4c175de7cc8df0fb4185b09dab229/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/NnOps.java#L3109-L3131 that it currently accepts TopK.Options[] options

Describe the expected behavior
It should accept variadic argument TopK.Options... options just like its variant https://github.com/tensorflow/java/blob/e9c854fba1e4c175de7cc8df0fb4185b09dab229/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/NnOps.java#L3154-L3157

Code to reproduce the issue
Calling tf.nn.topK(input, k) would be a method not found

Other info / logs

Method topK(org.tensorflow.op.core.Placeholder,org.tensorflow.op.core.Constant) cannot be found on type org.tensorflow.op.NnOps

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Inspect tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/NnOps.java around lines 3109-3131 and compare the nearby variant at lines 3154-3157. Reproduce the reported tf.nn.topK(input, k) call and verify that the method accepts the expected options form and can be found by the Java API.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.