mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Rename the argument label `in:` in `gradient(at:in:)`, `pullback(at:in:)`, etc to `of:`, as suggested in the [pitch thread](https://forums.swift.org/t/differentiable-programming-for-gradient-based-machine-learning/42147).
13 lines
309 B
Swift
13 lines
309 B
Swift
// RUN: %target-build-swift %s
|
|
// RUN: %target-swift-frontend -c -g -Xllvm -verify-di-holes=true %s
|
|
|
|
// rdar://74087329 (DI verification failure with trampoline blocks in VJP)
|
|
|
|
import _Differentiation
|
|
|
|
func foo(x: Float?) -> Float {
|
|
_ = withoutDerivative(at: x ?? 0)
|
|
return 0
|
|
}
|
|
gradient(at: 0, of: foo)
|