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
// expected-error @+1 {{function is not differentiable}}
46
46
_ =gradient(at:NoDerivativeProperty(x:1, y:1)){ s ->Floatin
47
47
vartmp= s
48
-
// expected-note @+1 {{cannot differentiate through a '@noDerivative' stored property; do you want to add '.withoutDerivative()'?}}
48
+
// expected-note @+1 {{cannot differentiate through a '@noDerivative' stored property; do you want to use 'withoutDerivative(at:)'?}}
49
49
tmp.y = tmp.x
50
50
return tmp.x
51
51
}
52
52
_ =gradient(at:NoDerivativeProperty(x:1, y:1)){ s in
53
-
// expected-warning @+1 {{result does not depend on differentiation arguments and will always have a zero derivative; do you want to add '.withoutDerivative()'?}} {{13-13=.withoutDerivative()}}
53
+
// expected-warning @+1 {{result does not depend on differentiation arguments and will always have a zero derivative; do you want to use 'withoutDerivative(at:)'?}} {{10-10=withoutDerivative(at:}} {{13-13=)}}
54
54
return s.y
55
55
}
56
56
_ =gradient(at:NoDerivativeProperty(x:1, y:1)){
57
-
// expected-warning @+1 {{result does not depend on differentiation arguments and will always have a zero derivative; do you want to add '.withoutDerivative()'?}} {{7-7=.withoutDerivative()}}
57
+
// expected-warning @+1 {{result does not depend on differentiation arguments and will always have a zero derivative; do you want to use 'withoutDerivative(at:)'?}} {{3-3=withoutDerivative(at:}} {{7-7=)}}
// expected-error @+2 {{expression is not differentiable}}
77
-
// expected-note @+1 {{cannot differentiate through a non-differentiable result; do you want to add '.withoutDerivative()'?}}
77
+
// expected-note @+1 {{cannot differentiate through a non-differentiable result; do you want to use 'withoutDerivative(at:)'?}}
78
78
returnFloat(Int(x))
79
79
}
80
80
@@ -225,7 +225,7 @@ let no_return: @differentiable (Float) -> Float = { x in
225
225
@differentiable
226
226
// expected-note @+1 {{when differentiating this function definition}}
227
227
func roundingGivesError(x:Float)->Float{
228
-
// expected-note @+1 {{cannot differentiate through a non-differentiable result; do you want to add '.withoutDerivative()'?}}
228
+
// expected-note @+1 {{cannot differentiate through a non-differentiable result; do you want to use 'withoutDerivative(at:)'?}}
229
229
returnFloat(Int(x))
230
230
}
231
231
@@ -261,7 +261,7 @@ func one() -> Float {
261
261
}
262
262
@differentiable
263
263
func nonVariedResult(_ x:Float)->Float{
264
-
// expected-warning @+1 {{result does not depend on differentiation arguments and will always have a zero derivative; do you want to add '.withoutDerivative()'?}} {{15-15=.withoutDerivative()}}
264
+
// expected-warning @+1 {{result does not depend on differentiation arguments and will always have a zero derivative; do you want to use 'withoutDerivative(at:)'?}} {{10-10=withoutDerivative(at:}} {{15-15=)}}
0 commit comments