-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Serialization] Implement serialization for @differentiable attribute. #17155
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
[Serialization] Implement serialization for @differentiable attribute. #17155
Conversation
@swift-ci Please test tensorflow |
db622e5
to
1c1e89c
Compare
Implement (de)serialization for all components of `@differentiable` attribute except the trailing where clause (which needs to be type-checked). This is a necessary step for the `#adjoint` expression to look up `@differentiable` attributes declared on functions in other modules correctly. Addresses SR-7977.
1c1e89c
to
d4da28d
Compare
DeclIDField, // Adjoint function declaration. | ||
BCArray<BCFixed<32>> // Differentiation parameters. | ||
>; | ||
|
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.
VERSION_MINOR in this file needs to be bumped.
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.
Thanks! Done in d7ea8bc.
6cce8ef
to
d7ea8bc
Compare
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.
Awesome work!
@@ -55,7 +55,7 @@ const uint16_t VERSION_MAJOR = 0; | |||
/// describe what change you made. The content of this comment isn't important; | |||
/// it just ensures a conflict if two people change the module format. | |||
/// Don't worry about adhering to the 80-column limit for this line. | |||
const uint16_t VERSION_MINOR = 405; // SWIFT_ENABLE_TENSORFLOW: graph_op. | |||
const uint16_t VERSION_MINOR = 406 // SWIFT_ENABLE_TENSORFLOW: serialize @differentiable. |
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.
Semicolon
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.
Done, thanks.
for (auto paramValue : paramValues) { | ||
auto parameter = paramValue & 0x01 | ||
? AutoDiffParameter::getSelfParameter(SourceLoc()) | ||
: AutoDiffParameter::getIndexParameter(SourceLoc(), paramValue>>1); |
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.
paramValue >> 1
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.
Done, minor refactoring to keep things within 80 cols.
I too love spaces around operators.
Address comments from @rxwei.
@swift-ci Please test tensorflow |
@swift-ci Please test tensorflow |
#17155) Implement (de)serialization for all components of `@differentiable` attribute except the trailing where clause (which needs to be type-checked). This is a necessary step for the `#adjoint` expression to look up `@differentiable` attributes declared on functions in other modules correctly. Addresses SR-7977.
swiftlang#17155) Implement (de)serialization for all components of `@differentiable` attribute except the trailing where clause (which needs to be type-checked). This is a necessary step for the `#adjoint` expression to look up `@differentiable` attributes declared on functions in other modules correctly. Addresses SR-7977.
#17155) Implement (de)serialization for all components of `@differentiable` attribute except the trailing where clause (which needs to be type-checked). This is a necessary step for the `#adjoint` expression to look up `@differentiable` attributes declared on functions in other modules correctly. Addresses SR-7977.
#17155) Implement (de)serialization for all components of `@differentiable` attribute except the trailing where clause (which needs to be type-checked). This is a necessary step for the `#adjoint` expression to look up `@differentiable` attributes declared on functions in other modules correctly. Addresses SR-7977.
Implement serialization/deserialization for all components of
@differentiable
attribute except the trailing where clause (which needs to be type-checked).This is a necessary step for the
#adjoint
expression to look up@differentiable
attributes declared on functions in other modules.Addresses SR-7977.