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

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
Labels
good first issue Good for newcomers

Comments

@marcrasi
Copy link
Contributor

+=, -=, *= 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.

@marcrasi marcrasi added the good first issue Good for newcomers label Jul 24, 2020
@iamsdas
Copy link

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

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 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 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 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 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 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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants