Skip to content

[AutoDiff] forbid @derivative of protocol req#28890

Merged
dan-zheng merged 2 commits into
tensorflowfrom
marcrasi-forbid-retrodiff-protocol-req
Dec 23, 2019
Merged

[AutoDiff] forbid @derivative of protocol req#28890
dan-zheng merged 2 commits into
tensorflowfrom
marcrasi-forbid-retrodiff-protocol-req

Conversation

@marcrasi
Copy link
Copy Markdown

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 dan-zheng and rxwei December 20, 2019 01:15
Copy link
Copy Markdown
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
Copy Markdown
Contributor

saeta commented Dec 20, 2019

Nice! Thanks @marcrasi !

@marcrasi
Copy link
Copy Markdown
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
Copy Markdown
Author

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

@swift-ci please test tensorflow

@marcrasi
Copy link
Copy Markdown
Author

@swift-ci please test tensorflow

3 similar comments
@marcrasi
Copy link
Copy Markdown
Author

@swift-ci please test tensorflow

@marcrasi
Copy link
Copy Markdown
Author

@swift-ci please test tensorflow

@marcrasi
Copy link
Copy Markdown
Author

@swift-ci please test tensorflow

@dan-zheng
Copy link
Copy Markdown
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