mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
15 lines
250 B
Swift
15 lines
250 B
Swift
import _Differentiation
|
|
|
|
@differentiable
|
|
public func defaultArgument(_ x: Float) -> Float {
|
|
return x
|
|
}
|
|
|
|
@differentiable
|
|
public func applyArgument(
|
|
_ x: Float,
|
|
_ f: @differentiable (Float) -> Float = defaultArgument
|
|
) -> Float {
|
|
return f(x)
|
|
}
|