Skip to content

[Docs] [AutoDiff] Add derivative/transpose registration typing rules #28925

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 5 commits into from
Jan 19, 2020

Conversation

rxwei
Copy link
Contributor

@rxwei rxwei commented Dec 22, 2019

  • Document the typing rules of derivative/transpose registration (a.k.a. @derivative and @transpose declaration attributes).
  • Introduce differentiability parameter, linearity parameter, differentiability generic requirement, and linearity generic requirement.
  • Require Self == Self.TangentVector for differentiability parameters.

@rxwei rxwei force-pushed the derivative-registration-typing-rules branch 5 times, most recently from f288dca to f98518c Compare December 22, 2019 20:20
@rxwei rxwei force-pushed the derivative-registration-typing-rules branch from f98518c to a8e233f Compare December 22, 2019 20:21
Copy link
Contributor

@bartchr808 bartchr808 left a comment

Choose a reason for hiding this comment

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

Small changes/questions, looks great! :shipit:

Comment on lines +2119 to +2123
When a function's differentiability is provided by a derivative/transpose
function, the access scope of differentiability is identical to the
derivative/transpose function's access scope. For example, a `fileprivate`
derivative function in `B.swift` only overrides the original function's
derivative in `B.swift`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice example! 😄

@rxwei
Copy link
Contributor Author

rxwei commented Jan 19, 2020

@swift-ci please smoke test and merge

@swift-ci swift-ci merged commit 1b0eee9 into master Jan 19, 2020
@compnerd compnerd deleted the derivative-registration-typing-rules branch May 31, 2025 20:33
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