Skip to content

[Docs] [AutoDiff] Allow implicitly inherited '@differentiable' on non-public protocol req impls. #29307

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 1 commit into from
Jan 19, 2020

Conversation

rxwei
Copy link
Contributor

@rxwei rxwei commented Jan 19, 2020

Currently, when a conforming type implements a @differentiable protocol requirement, the corresponding conforming implementation is required to have at least a @differentiable that covers all differentiability parameters in the protocol requirement. However, this is not a great design for usability because developers almost always start with missing @differentiable and getting a compilation error. This also makes ML models built with libraries that use differentiable programming more verbose than those built with other ML frameworks.

We agreed during this Friday's design review to allow @differentiable to be implicitly inherited from protocols when the conforming implementation is non-public.

…-public declarations.

Currently, when a conforming type implements a `@differentiable` protocol requirement, the corresponding conforming implemnetation is required to have at least a `@differentiable` that covers all differentiability parameters in the protocol requirement.  However, this is not a great design for usability because developers almost always start with missing `@differentiable` and getting an compilation error.  This also makes ML models built with libraries that use differentiable programming more verbose than those built with other ML frameworks.

We agreed during this Friday's design review to allow `@differentiable` to be implicitly inherited from protocols when the conforming implementation is non-public.
@rxwei rxwei requested a review from dan-zheng January 19, 2020 05:29
@rxwei rxwei changed the title [Docs] [AutoDiff] Allow implicitly inherited '@differentiable' on non-public declarations. [Docs] [AutoDiff] Allow implicitly inherited '@differentiable' on non-public protocol req impls. Jan 19, 2020
Copy link
Contributor

@dan-zheng dan-zheng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

An aside: we've received feedback that what's implemented vs what's not implemented isn't clear in the ∂p manifesto, causing some confusion.

@rxwei
Copy link
Contributor Author

rxwei commented Jan 19, 2020

An aside: we've received feedback that what's implemented vs what's not implemented isn't clear in the ∂p manifesto, causing some confusion.

This should definitely be addressed separately, ideally in the form of inline notes and checkboxes.

@rxwei
Copy link
Contributor Author

rxwei commented Jan 19, 2020

@swift-ci please smoke test and merge

@swift-ci swift-ci merged commit a4fcc48 into swiftlang:master Jan 19, 2020
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.

3 participants