The Wayback Machine - https://web.archive.org/web/20201016181802/https://github.com/tensorflow/swift-apis/issues/1048
Skip to content
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

some mutating tensor operations are not @differentiable #1048

Open
marcrasi opened this issue Jul 24, 2020 · 7 comments
Open

some mutating tensor operations are not @differentiable #1048

marcrasi opened this issue Jul 24, 2020 · 7 comments

Comments

@marcrasi
Copy link
Contributor

@marcrasi marcrasi commented Jul 24, 2020

+=, -=, *= in https://github.com/tensorflow/swift-apis/blob/master/Sources/TensorFlow/Operators/Math.swift are not differentiable, but it should be pretty straightforward to make them differentiable.

@iamsdas
Copy link

@iamsdas iamsdas commented Jul 29, 2020

Just starting out with swift for tensorflow. So do we only need to add @differentiable(where Scalar: TensorFlowFloatingPoint) or am I missing something?

@marcrasi
Copy link
Contributor Author

@marcrasi marcrasi commented Jul 29, 2020

Oh yes, I think that is all that you need to do. (If the mutating operations were implemented in terms of other functions that were not differentiable, then you would need to actually specify what the derivative is, but it looks like the mutating operations are defined in terms of functions that are differentiable.)

Also some tests that the derivatives work are important.

@iamsdas
Copy link

@iamsdas iamsdas commented Aug 1, 2020

Is there any way to test the changes without compiling the entire swift for tensorflow toolchain?

@marcrasi
Copy link
Contributor Author

@marcrasi marcrasi commented Aug 3, 2020

Yes, you can use the the toolchain binaries at https://github.com/tensorflow/swift/blob/master/Installation.md if you have one of the supported operating systems.

@iamsdas
Copy link

@iamsdas iamsdas commented Aug 3, 2020

I meant if I customize the above mentioned file won't I need to recompile the entire thing?

@marcrasi
Copy link
Contributor Author

@marcrasi marcrasi commented Aug 3, 2020

Ah, I see what you mean. The quickest way to test the change is to add a test somewhere in Tests/... and then run swift test in the root directory of this repo. This will compile the repo and run the tests, which should only take a few minutes.

@Santhosh-KS
Copy link

@Santhosh-KS Santhosh-KS commented Sep 27, 2020

I would like to work on this. Please let me know if I can pick it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.