You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SR-13149@derivative and @transpose type-checking diagnostic improvements
Issue Description:
When the compiler encounters an ambiguous reference, the compiler should print out where the ambiguity is coming from to help guide the user to understand what's going wrong.
File:
importTensorFlowprotocolFoo {
funcfoo(_x: Int) -> Self
}
protocolBar: Foo, Differentiable {
@differentiable(wrt: self)
funcfoo(_x: Int) -> Self
}
extensionKeyPathIterable {
funcfoo(_x: Int) -> Self { self }
}
// This allows KeyPathIterable things to conform to Bar easily.extensionKeyPathIterablewhereSelf: Differentiable {
// Note: thanks to retroactive conformances, you don't even need this,// but if you do accidentally (or intentionally) write it, we should give// a nicer compiler error message.@differentiable(wrt: self)
funcfoo(_x: Int) -> Self { self }
@derivative(of: foo(_:), wrt: self)
func_vjpFoo(_x: Int) -> (value: Self, pullback: (TangentVector) -> TangentVector) {
fatalError("Unimplemented")
}
}
Note: as the comment says, the user don't actually need to write two implementations of the foo function, as retroactive differentiability is exactly what you want. Context: this came up while working on eaplatanios/swift-rl#6
The text was updated successfully, but these errors were encountered:
Additional Detail from JIRA
md5: d1c22ceb1cbc545cbe3b8f0aeb6f7c42
Parent-Task:
@derivative
and@transpose
type-checking diagnostic improvementsIssue Description:
When the compiler encounters an ambiguous reference, the compiler should print out where the ambiguity is coming from to help guide the user to understand what's going wrong.
File:
Compiler output:
Desired output (something like the following which indicates where the ambiguities are coming from):
Note: as the comment says, the user don't actually need to write two implementations of the
foo
function, as retroactive differentiability is exactly what you want. Context: this came up while working on eaplatanios/swift-rl#6The text was updated successfully, but these errors were encountered: