tensorflow / tensorflow/java

automatically generate op convenience overloads?

Open
#246 11 comments 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

Should we extend the code generation for ops to automatically generate convenience overloads? This would help reduce the gap between Python notation and Java notation.

As an example of where we stand now, here's some Python code (keras/metrics.py, around line 2203):

    dp = p[:self.num_thresholds - 1] - p[1:]

And here's the corresponding Java code (AUC.java, around line 809):

    Operand<T> dP =
        tf.math.sub(
            tf.slice(
                p, tf.constant(new int[] {0}), tf.constant(new int[] {getNumThresholds() - 1})),
            tf.slice(p, tf.constant(new int[] {1}), tf.constant(new int[] {-1})));

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

Start by comparing the Python example in keras/metrics.py around line 2203 with the Java implementation in AUC.java around line 809. Determine which convenience overloads should be generated and how the Python and Java forms should correspond; done requires an agreed generation scope and resulting Java API.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, tensorflow
Domain
api, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.