Skip to content

[AutoDiff] Add missing vjp, jvp functions to existing FloatingPoint initializers #70688

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 2 commits into from
Jan 5, 2024

Conversation

JaapWijnen
Copy link
Contributor

This PR adds jvp's and vjp's to already existing FloatingPoint initializers that allow to convert between floating point types, making the example below differentiable:

let f = Float(3.0)
let d = Double(f)

Previously jvp's and vjp's were added to the FloatingPoint initializers that took the same FP type as an argument in #64417 . But not to the initializers taking other FP types as arguments (for example converting from a Float to a Double).

Jaap Wijnen added 2 commits January 3, 2024 15:48
Adds derivatives to already existing initializers that allow converting between floating point type. For example converting a Float to a Double.
@JaapWijnen JaapWijnen requested a review from a team as a code owner January 3, 2024 15:05
@JaapWijnen
Copy link
Contributor Author

Tagging @BradLarson

@BradLarson
Copy link
Contributor

@swift-ci Please test

@BradLarson BradLarson requested review from asl and rxwei January 3, 2024 20:58
Copy link
Contributor

@asl asl left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@asl asl merged commit dfe1e69 into swiftlang:main Jan 5, 2024
Catfish-Man pushed a commit to Catfish-Man/swift that referenced this pull request Jan 19, 2024
…nitializers (swiftlang#70688)

Adds derivatives to already existing initializers that allow converting between floating point type. For example converting a Float to a Double.

Co-authored-by: Jaap Wijnen <[email protected]>
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