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

Added support for 'Tensor.batchGathering(atIndices:)'. #157

Merged
merged 44 commits into from
Jun 21, 2019

Conversation

eaplatanios
Copy link
Contributor

@rxwei this also makes use of Tensor.withoutDerivative where Scalar is not differentiable. How do you think we should avoid these uses here?

I also have a more general version of this that requires control flow AD so instead of committing it as non-differentiable but more general function now, I'll leave that one for later.

eaplatanios and others added 26 commits May 30, 2019 18:47
@eaplatanios
Copy link
Contributor Author

eaplatanios commented Jun 7, 2019

@rxwei I removed Tensor.nonZeroIndices(), as discussed and added a noDerivative global function helper. I could not name it withoutDerivative because that causes compilation errors due to a conflicts with the existing withoutDerivative. This passes all tests now.

I'd prefer we call it withoutDerivative and remove the existing withoutDerivative method though from Differentiable.

@eaplatanios
Copy link
Contributor Author

Nvm the Tensor.nonZeroIndices() edit. It's actually used by Tensor.gathering(where:) and has already been merged into master.

@eaplatanios
Copy link
Contributor Author

@rxwei I updated this PR so that all tests pass, but there is one issue that came up. I had to use Swift.withoutDerivative(at:in:) because if I don't use the module to disambiguate the compiler tries to use the instance method of Differentiable and fails. Not sure why though since the signatures are different. This seems like a compiler bug.

@rxwei
Copy link
Contributor

rxwei commented Jun 20, 2019

Swift.withoutDerivative(at:in:) sounds good. This is a bug which I was trying to fix with swiftlang/swift#25316, but it needs a more work to get there.

@eaplatanios
Copy link
Contributor Author

Right, I also noticed the same problem with the new elementary function support. Thanks for the update! This should be ready to merge then, along with the few other PRs I updated today. I also ran CI tests on them.

@rxwei
Copy link
Contributor

rxwei commented Jun 21, 2019

Just got back from a conference. Will get to these PRs tonight!
For this particular one, feel free to merge when the comment above is addressed.

@eaplatanios
Copy link
Contributor Author

Thanks Richard!

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

Successfully merging this pull request may close these issues.

3 participants