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

Make derivatives of public functions be @usableFromInline. #929

Merged

Conversation

dan-zheng
Copy link
Member

Friend PR: swiftlang/swift#31527

Require @derivative functions and their original functions to have the same access level.
Public original functions may also have internal @usableFromInline derivatives, as a special case. Diagnose access level mismatches.

This simplifies derivative registration rules, and may enable simplification of AutoDiff symbol linkage rules.

@dan-zheng dan-zheng force-pushed the derivative-same-access-level branch from ec16b6c to adae0d5 Compare May 4, 2020 16:42
@dan-zheng dan-zheng requested a review from marcrasi May 5, 2020 01:18
@dan-zheng
Copy link
Member Author

I built a toolchain from swiftlang/swift#31527 (requiring same original/derivative access levels), and confirmed that tensorflow/swift-apis builds after this patch.

tensorflow/swift-models builds without any patches.

@dan-zheng
Copy link
Member Author

It's fine to merge this patch now before swiftlang/swift#31527 lands.

@dan-zheng dan-zheng merged commit 36b75a7 into tensorflow:master May 5, 2020
@dan-zheng dan-zheng deleted the derivative-same-access-level branch May 5, 2020 01:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants