-
Notifications
You must be signed in to change notification settings - Fork 215
Generate op input and attribute accessors #302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/GraphOperation.java
Outdated
Show resolved
Hide resolved
tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/GraphOperation.java
Outdated
Show resolved
Hide resolved
tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/GraphOperation.java
Outdated
Show resolved
Hide resolved
...-core/tensorflow-core-generator/src/main/java/org/tensorflow/op/generator/AttributeType.java
Outdated
Show resolved
Hide resolved
...core/tensorflow-core-generator/src/main/java/org/tensorflow/op/generator/ClassGenerator.java
Outdated
Show resolved
Hide resolved
...w-core/tensorflow-core-generator/src/main/java/org/tensorflow/op/generator/TypeResolver.java
Show resolved
Hide resolved
The formatting issues were since my IDE somehow got off google-java-format. I have the plugin now, which added some things that weren't in the XML. |
002fa85
to
faca5f4
Compare
Looks like the javadoc reformatting is still present |
Yeah, that happened when I applied the google-java-format plugin, and it matches the spec. Idk why the XML format didn't do it, I can revert to that. We really should set up some kind of CI formatter, I keep getting burnt by this. I haven't had time to look at it much but one of the plugins you linked in the lint PR looked like it did ktlint too (although it had a bug), that would be nice since we could to the Kotlin API in the same plugin. |
4436f16
to
e3f4561
Compare
Signed-off-by: Ryan Nett <[email protected]>
Signed-off-by: Ryan Nett <[email protected]>
Signed-off-by: Ryan Nett <[email protected]>
Signed-off-by: Ryan Nett <[email protected]>
Signed-off-by: Ryan Nett <[email protected]>
Signed-off-by: Ryan Nett <[email protected]>
Signed-off-by: Ryan Nett <[email protected]>
Signed-off-by: Ryan Nett <[email protected]>
Signed-off-by: Ryan Nett <[email protected]>
Signed-off-by: Ryan Nett <[email protected]>
Signed-off-by: Ryan Nett <[email protected]>
Signed-off-by: Ryan Nett <[email protected]>
Signed-off-by: Ryan Nett <[email protected]>
Signed-off-by: Ryan Nett <[email protected]>
Signed-off-by: Ryan Nett <[email protected]>
Signed-off-by: Ryan Nett <[email protected]>
Signed-off-by: Ryan Nett <[email protected]>
Signed-off-by: Ryan Nett <[email protected]>
Signed-off-by: Ryan Nett <[email protected]>
a32b212
to
0895e48
Compare
Reminder for myself: run generation before merging! I'm going to work on a CI test for that. |
tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/GraphOperation.java
Show resolved
Hide resolved
FYI @karllessard I'm going to be out of town most of the next 2 weeks or so. I might have time to follow up on these PRs, but I'm not sure. Feel free to take things over. I should at least be able to reply to comments. |
Signed-off-by: Ryan Nett <[email protected]>
Signed-off-by: Ryan Nett <[email protected]>
Signed-off-by: Ryan Nett <[email protected]>
Signed-off-by: Ryan Nett <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @rnett !
@rnett , can you please fix the conflict with |
Let me generate the op files first, too. |
I've been toying with the idea of a CI check that checks |
That's interesting, indeed! Shouldn't be hard to do. Though it looks like we still have this non-deterministic order of the |
Signed-off-by: Ryan Nett <[email protected]>
Yeah, good point, I'll look at that first. |
Looks good, I've just merged another PR (#388) though so I'll wait that one to complete building before merging this one. |
@rnett , I've just realized that we forgot to a CI build round on this PR before merging it... :( Failing on Windows: https://github.com/tensorflow/java/runs/3908491275?check_suite_focus=true It fails on Linux too but it looks more like a bug we are having with the Bazel cache and that was happening before. CC\ @saudet |
I think I know what that is, I just need to skip a bunch of things that aren't exported on windows. |
This adds a nested class to the generated op classes that contains typesafe (and not quite type safe) accessors for the op inputs and attributes. It's only supported for graph ops at the moment, but it will eventually support
ForwardOperation
s as well (from the eager gradient support). The main use for this is defining custom gradients, whether it's the legacy graph gradients or the new gradient API.I haven't committed the generated outputs to make it easier to review, I'll do so after approval or in another PR.