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
[AutoDiff] Disallow JVP/VJP in protocol requirement @differentiable attribute. (#26113)
Protocol requirements cannot specify `jvp:` or `vjp:` in `@differentiable`
attribute. This is because all witnesses must specify a `@differentiable`
attribute with the same configuration, so all witnesses will have their own
JVP/VJP (either specified or generated).
Reorganize tests.
Resolves TF-651.
Exposes TF-650: diagnose protocol default implementations missing
`@differentiable` attribute.
// Missing `@differentiable` attribute, without printing the 'wrt' arguments.
851
-
852
-
protocolDifferentiableWhereClause:Differentiable{
853
-
associatedtypeScalar
854
-
855
-
@differentiable(where Scalar: Differentiable) // expected-error {{'where' clauses cannot be used in a '@differentiable' attribute on a protocol requirement}}
856
-
func test(value:Scalar)->Float
857
-
}
858
-
859
-
// Missing a `@differentiable` attribute.
879
+
// Test refining protocol requirements with `@differentiable` attribute.
860
880
861
881
publicprotocolDistribution{
862
882
associatedtypeValue
@@ -870,18 +890,25 @@ public protocol DifferentiableDistribution: Differentiable, Distribution {
0 commit comments