-
Notifications
You must be signed in to change notification settings - Fork 214
Indexing API #166
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
Indexing API #166
Conversation
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.
More generally these indices don't seem to link up with the indexing operations already available in ndarray, which might prove more confusing as the ndarrays move closer to Tensors given Karl's current refactorings.
tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/Ops.java
Outdated
Show resolved
Hide resolved
tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/core/Indexing.java
Outdated
Show resolved
Hide resolved
I looked at that, there's a few concepts that are impossible to map into If we do want to unify APIs, I think it would be easier to map this API onto the current ndarray one the visa versa. To map the ndarray indices onto Operands we'd either have to remove index options, throw runtime exceptions for unsupported ones, or have a |
I think extending the ndarray API to cover the gaps would be worthwhile, and then we can throw exceptions for things which fail to map from ndarray into TF ops. |
There's some odd things in the ndarray API like |
Yes, if something is lacking in the
That was the original intent, we are just not there yet. Again (sorry for that), the tensor type refactoring currently in progress might be helpful to achieve this. I also thing that Should we also put this PR on hold for now and continue that discussion in #164 ? |
That would be very nice, especially for eager mode, although I'd have to be careful w/ the names for indexing functions (Operand will always be stridedSlice, but NDArray should be something that makes it obvious it's on the NDArray). I pushed what I have as far as adding to the ndarray API (it's WIP), it doesn't seem that bad, just newaxis, ellipsis, and strided slice. My impression from the refactoring is that Operand indexing will still have to use StridedSlice? If so most of this PR is still fine, I just need to move the builders to the NDArray builders and unify the APIs (which is mostly done as of the latest commit, just needs cleanup). I'll add a comment to #164 about the API unification changes I would like to make. Depending on the type refactorings you are working on, it seems like once the APIs are merged, we could merge this without running afoul of the upcoming changes. |
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
2 similar comments
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
Idem than #167 (comment) |
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
@karllessard can you re-open this PR too? I don't have the permissions to. |
I'm really sorry, I don't know why but it does not allow me to do it neither, though I was able to do it with #167 ... |
Can you try this? https://gist.github.com/robertpainsi/2c42c15f1ce6dab03a0675348edd4e2c |
@karllessard I still have no re-open option, but I did the steps there. Can you do it now? I never had the option, even greyed out, I suspect it's permissions in addition to the force push. |
Ok, this is ready for review. One last thing: I'd like to move the builders from |
Signed-off-by: Ryan Nett <rnett@calpoly.edu>
Signed-off-by: Ryan Nett <rnett@calpoly.edu>
Signed-off-by: Ryan Nett <rnett@calpoly.edu>
Signed-off-by: Ryan Nett <rnett@calpoly.edu>
Signed-off-by: Ryan Nett <rnett@calpoly.edu>
Signed-off-by: Ryan Nett <rnett@calpoly.edu>
Signed-off-by: Ryan Nett <rnett@calpoly.edu>
Signed-off-by: Ryan Nett <rnett@calpoly.edu>
Signed-off-by: Ryan Nett <rnett@calpoly.edu>
Signed-off-by: Ryan Nett <rnett@calpoly.edu>
Signed-off-by: Ryan Nett <rnett@calpoly.edu>
Signed-off-by: Ryan Nett <rnett@calpoly.edu>
Signed-off-by: Ryan Nett <rnett@calpoly.edu>
Signed-off-by: Ryan Nett <rnett@calpoly.edu>
Signed-off-by: Ryan Nett <rnett@calpoly.edu>
Signed-off-by: Ryan Nett <rnett@calpoly.edu>
Signed-off-by: Ryan Nett <rnett@calpoly.edu>
ndarray/src/main/java/org/tensorflow/ndarray/index/Indices.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Ryan Nett <rnett@calpoly.edu>
Signed-off-by: Ryan Nett <rnett@calpoly.edu>
Before you merge, any more thoughts on |
Yeah I was thinking about that... while I do prefer to move static creators to I always had in mind that Why not doing it in a seperate PR? That one is fully backward compatible, which I like. |
Another PR is fine, although I don't know that there will be enough impetus to make one, it's a pretty tiny change. I'd like to have infix or |
Fixes #164.
One question: Should I also make endpoints named
get
andset
? It's more discoverable to people coming from Python (who usually use[]
rather than the stridedSlice op).There's examples in the
Index
javadoc.