mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
14 lines
348 B
Swift
14 lines
348 B
Swift
import _Differentiation
|
|
import a
|
|
|
|
extension Struct: Differentiable {
|
|
public struct TangentVector: Differentiable & AdditiveArithmetic {}
|
|
public mutating func move(along _: TangentVector) {}
|
|
|
|
@usableFromInline
|
|
@derivative(of: method, wrt: x)
|
|
func vjpMethod(_ x: Float) -> (value: Float, pullback: (Float) -> Float) {
|
|
(x, { $0 })
|
|
}
|
|
}
|