-
Notifications
You must be signed in to change notification settings - Fork 10.6k
[AutoDiff] Unify code for differentiation parameter inference. #23350
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
Conversation
include/swift/AST/AutoDiff.h
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed setAllParameters because it has no usages and is subsumed by inferParameters.
It would be possible to implement inferParameters using setAllParameters if AutoDiffParameterIndicesBuilder stored a functionType, but it doesn't.
d6cbf87 to
b87d54e
Compare
lib/AST/AutoDiff.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: conformsToDifferentiableInModule is duped in TypeCheckAttr.cpp. It could be declared in AutoDiff.h to eliminate dupe, holding off for now though.
Previously, `@differentiable` attribute type-checking used ad-hoc differentiation parameter inference logic. Now, that differentiation parameter inference logic has been moved to `AutoDiffParameterIndicesBuilder::inferParameters` so that it can be shared with `@differentiable` attribute type-checking. Add retroactive derivative tests. Resolves TF-363.
- Move tests to `test/AutoDiff/derivative_registration.swift`. - Document differentiation parameter inference rules.
|
@swift-ci Please test tensorflow |
|
@swift-ci Please test tensorflow macOS |
|
@swift-ci Please test tensorflow linux GPU |
…lang#23350) Previously, `@differentiable` attribute type-checking used ad-hoc differentiation parameter inference logic. Now, that differentiation parameter inference logic has been moved to `AutoDiffParameterIndicesBuilder::inferParameters` so that it can be shared with `@differentiable` attribute type-checking. Add derivative registration tests. Resolves TF-363.
Previously,
@differentiableattribute type-checking used ad-hocdifferentiation parameter inference logic.
Now, that differentiation parameter inference logic has been moved to
AutoDiffParameterIndicesBuilder::inferParametersso that it can be sharedwith
@differentiableattribute type-checking.Add retroactive derivative tests.
Resolves TF-363.