Skip to content
This repository was archived by the owner on Jul 1, 2023. It is now read-only.

Added support for 'gathering' and its VJP. #151

Closed
wants to merge 15 commits into from

Conversation

eaplatanios
Copy link
Contributor

No description provided.

@eaplatanios eaplatanios requested a review from rxwei May 31, 2019 01:26
@eaplatanios eaplatanios added the enhancement New feature or request label May 31, 2019
Copy link
Contributor

@rxwei rxwei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@rxwei
Copy link
Contributor

rxwei commented May 31, 2019

I think this one needs to pull from master.

@eaplatanios
Copy link
Contributor Author

@rxwei this should be ready now.

/// // [2, 1, 1]]
/// ```
///
/// - Returns: A tensor with shape `(num_true, rank(condition))`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

num_true isn't defined anywhere. Maybe reword this?

}
}

public extension Tensor {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that this API should be kept internal until we find a good spelling/semantics for it. The fact that it applies to Tensor<Bool> makes the nonZero name weird.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could split it in two functions: nonZeroIndices and falseIndices or something like that. How does that sound?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linguistically those adjectives are attached to "indices", which is not the intended meaning and could cause confusion. Also, which Python TF operator does it correspond to?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's part of the tf.where functionality when no x and y are provided (i.e., only condition is provided).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems this is not being used by the implementation of gathering. Could we defer this to later PRs instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's true. I think it's used by one of the other PRs so I'll just move it there.

@rxwei
Copy link
Contributor

rxwei commented Jun 17, 2019

@eaplatanios Is it correct that this PR isn't blocked on any bugs?

@googlebot
Copy link

So there's good news and bad news.

👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there.

😕 The bad news is that it appears that 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 here in the pull request.

Note to project maintainer: This is a terminal state, meaning the cla/google commit status will not change from this state. It's up to you to confirm consent of all the commit author(s), set the cla label to yes (if enabled on your project), and then merge this pull request when appropriate.

ℹ️ Googlers: Go here for more info.

@rxwei rxwei closed this Jun 17, 2019
@rxwei
Copy link
Contributor

rxwei commented Jun 17, 2019

Looks like #156 has already added everything!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants