Skip to content

[AutoDiff] forbid @derivative of protocol req #28890

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

Merged
merged 2 commits into from
Dec 23, 2019

Conversation

marcrasi
Copy link

Until TF-982 is implemented, @derivatives of protocol requirements don't do anything. Therefore, this PR forbids them and adds a test that they are forbidden.

I am doing this because it fixes a problem that prevents me from removing vjp: from FloatingPoint.squareRoot. The problem is that you get an "ambiguous reference" error because it can't tell if you want the @derivative on the requirement or the default implementation. This PR also adds a test that this problem is fixed (protocol HasADefaultImplementation).

The portions of this PR in code that have been upstreamed should be upstreamed. I will do this in a separate PR after merging this PR, because I want to run this PR through our full tensorflow-specific test suite.

@marcrasi marcrasi requested review from rxwei and dan-zheng December 20, 2019 01:15
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.

Yay!

@saeta
Copy link
Contributor

saeta commented Dec 20, 2019

Nice! Thanks @marcrasi !

@marcrasi
Copy link
Author

@swift-ci please test tensorflow

@marcrasi marcrasi force-pushed the marcrasi-forbid-retrodiff-protocol-req branch from d5aed23 to 4b4111b Compare December 20, 2019 17:01
@marcrasi
Copy link
Author

swift-ci caught a simple failure. Should be fixed now.

@swift-ci please test tensorflow

@marcrasi
Copy link
Author

@swift-ci please test tensorflow

3 similar comments
@marcrasi
Copy link
Author

@swift-ci please test tensorflow

@marcrasi
Copy link
Author

@swift-ci please test tensorflow

@marcrasi
Copy link
Author

@swift-ci please test tensorflow

@dan-zheng
Copy link
Contributor

Merging now! Changes can be upstreamed after the holiday freeze.

@dan-zheng dan-zheng merged commit 54b8508 into tensorflow Dec 23, 2019
@dan-zheng dan-zheng deleted the marcrasi-forbid-retrodiff-protocol-req branch December 23, 2019 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants