-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[AutoDiff] Introduce 'linear_function' and 'linear_function_extract' instructions. #27637
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
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.
LGTM!
Please add round-trip tests (parsing, (de)serialization, printing) à la differentiable_function_inst.sil
.
@@ -7845,7 +7845,7 @@ class TryApplyInst final | |||
}; | |||
|
|||
// SWIFT_ENABLE_TENSORFLOW | |||
/// `differentiable_function` - given a function and differentiation indices and | |||
/// `differentiable_function` - given a function, differentiation indices and |
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.
Minor: Oxford comma please (used below for linear_function
) 🙂
/// `differentiable_function` - given a function, differentiation indices and | |
/// `differentiable_function` - given a function, differentiation indices, and |
As mentioned in the PR description, this PR is work in progress. |
There turns out to be a large portion of |
Ok, everything is working now after various fixes in parsing and lowering. I will split this patch into multiple. |
b4ba4ff
to
5af2b01
Compare
@swift-ci please test tensorflow |
@swift-ci please test tensorflow |
Introduce
linear_function
andlinear_function_extract
instructions, which are used for creating and destructing@differentiable(linear)
functions.linear_function
instructionBundles a function with its transpose function into a
@differentiable(linear)
function.linear_function_extract
instructionExtracts the original function or a transpose function from the given
@differentiable(linear)
function. It must be provided with an extractee:[original]
or[transpose]
.Resolves TF-907.