We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
md5: ade1d1d5746c480bf642439650ccd571
Parent-Task:
Issue Description:
After #28790 is merged,
public enum FunctionInModule1_InternalDerivatives { public static func f(_ x: Float) -> Float { x } @derivative(of: f) static func df(_ x: Float) -> (value: Float, pullback: (Float) -> Float) { (x, { $0 }) } public static func gradFFromModule1(_ x: Float) -> Float { gradient(at: x, in: f) } }
gives:
workspace/ufa.swift:8:82: error: function is not differentiable public static func gradFFromModule1(_ x: Float) -> Float { gradient(at: x, in: f) } ^ workspace/ufa.swift:2:22: note: differentiated functions in '@inlinable' functions must be marked '@differentiable' or have a public '@derivative' public static func f(_ x: Float) -> Float { x } ^
If you add `@usableFromInline` to `df`, the error goes away. If you write the same thing as top-level functions, the error goes away.
The text was updated successfully, but these errors were encountered:
Obsolete because I'm closing the PR that causes this.
Sorry, something went wrong.
No branches or pull requests
Additional Detail from JIRA
md5: ade1d1d5746c480bf642439650ccd571
Parent-Task:
Issue Description:
After #28790 is merged,
gives:
If you add `@usableFromInline` to `df`, the error goes away. If you write the same thing as top-level functions, the error goes away.
The text was updated successfully, but these errors were encountered: