mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Rename `move(along:)` to `move(by:)` based on the proposal feedback. The main argument for the change is that tangent vectors specify both a direction and a magnitude, whereas `along:` does not indicate that `self` is being moved by the specified magnitude.
14 lines
345 B
Swift
14 lines
345 B
Swift
import _Differentiation
|
|
import a
|
|
|
|
extension Struct: Differentiable {
|
|
public struct TangentVector: Differentiable & AdditiveArithmetic {}
|
|
public mutating func move(by _: TangentVector) {}
|
|
|
|
@usableFromInline
|
|
@derivative(of: method, wrt: x)
|
|
func vjpMethod(_ x: Float) -> (value: Float, pullback: (Float) -> Float) {
|
|
(x, { $0 })
|
|
}
|
|
}
|