-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Function incorrectly marked as not differentiable #75776
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
Comments
tagging @asl |
kovdan01
added a commit
to kovdan01/swift
that referenced
this issue
Nov 14, 2024
Inside inlinable functions, we expect functions to either be explicitly marked as differentiable or have a public explicit derivative defined. This is obviously not possible for single and double curry thunks which are a special case of `AutoClosureExpr`. Instead of looking at the thunk itself, we unwrap it and look at the function being wrapped. While the thunk itself and its differentiability witness will not have public visibility, it's not an issue for the case where the function being wrapped (and its witness) have public visibility. Fixes swiftlang#54819 Fixes swiftlang#75776
kovdan01
added a commit
to kovdan01/swift
that referenced
this issue
Nov 14, 2024
Inside inlinable functions, we expect functions to either be explicitly marked as differentiable or have a public explicit derivative defined. This is obviously not possible for single and double curry thunks which are a special case of `AutoClosureExpr`. Instead of looking at the thunk itself, we unwrap it and look at the function being wrapped. While the thunk itself and its differentiability witness will not have public visibility, it's not an issue for the case where the function being wrapped (and its witness) have public visibility. Fixes swiftlang#54819 Fixes swiftlang#75776
kovdan01
added a commit
to kovdan01/swift
that referenced
this issue
Nov 14, 2024
Inside inlinable functions, we expect functions to either be explicitly marked as differentiable or have a public explicit derivative defined. This is obviously not possible for single and double curry thunks which are a special case of `AutoClosureExpr`. Instead of looking at the thunk itself, we unwrap it and look at the function being wrapped. While the thunk itself and its differentiability witness will not have public visibility, it's not an issue for the case where the function being wrapped (and its witness) have public visibility. Fixes swiftlang#54819 Fixes swiftlang#75776
kovdan01
added a commit
to kovdan01/swift
that referenced
this issue
Nov 14, 2024
Inside fragile functions, we expect function derivatives to be public, which could be achieved by either explicitly marking the functions as differentiable or having a public explicit derivative defined for them. This is obviously not possible for single and double curry thunks which are a special case of `AutoClosureExpr`. Instead of looking at the thunk itself, we unwrap it and look at the function being wrapped. While the thunk itself and its differentiability witness will not have public visibility, it's not an issue for the case where the function being wrapped (and its witness) have public visibility. Fixes swiftlang#54819 Fixes swiftlang#75776
kovdan01
added a commit
to kovdan01/swift
that referenced
this issue
Nov 14, 2024
Inside fragile functions, we expect function derivatives to be public, which could be achieved by either explicitly marking the functions as differentiable or having a public explicit derivative defined for them. This is obviously not possible for single and double curry thunks which are a special case of `AutoClosureExpr`. Instead of looking at the thunk itself, we unwrap it and look at the function being wrapped. While the thunk itself and its differentiability witness will not have public visibility, it's not an issue for the case where the function being wrapped (and its witness) have public visibility. Fixes swiftlang#54819 Fixes swiftlang#75776
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
The following code does not compile giving the following error diagnostic:
This is incorrect however as the function itself is not a closure and is differentiable.
Reproduction
Expected behavior
Compile without error
Environment
Apple Swift version 6.0-dev (LLVM 097782ee554d9fe, Swift 60bf038)
Target: arm64-apple-macosx14.0
Additional information
No response
The text was updated successfully, but these errors were encountered: