@@ -2016,10 +2016,11 @@ differentiating either one will provide derivatives with respect to parameters
2016
2016
` T ` and ` U ` . Here are some examples of first-order function types and their
2017
2017
corresponding curried function types:
2018
2018
2019
- | First-order function type | Curried function type |
2020
- | @differentiable (T, U) -> V | @differentiable (T) -> @differentiable (U) -> V |
2021
- | @differentiable (T, @noDerivative U) -> V | @differentiable (T) -> (U) -> V |
2022
- | @differentiable (@noDerivative T, U) -> V | (T) -> @differentiable (U) -> V |
2019
+ | First-order function type | Curried function type |
2020
+ | ---------------------------------------------| ---------------------------------------------------|
2021
+ | ` @differentiable (T, U) -> V ` | ` @differentiable (T) -> @differentiable (U) -> V ` |
2022
+ | ` @differentiable (T, @noDerivative U) -> V ` | ` @differentiable (T) -> (U) -> V ` |
2023
+ | ` @differentiable (@noDerivative T, U) -> V ` | ` (T) -> @differentiable (U) -> V ` |
2023
2024
2024
2025
A curried differentiable function can be formed like any curried
2025
2026
non-differentiable function in Swift.
@@ -2540,9 +2541,7 @@ func valueWithDifferential<T: FloatingPoint, U: Differentiable>(
2540
2541
2541
2542
To differentiate `valueWithDifferential`, we need to be able to differentiate
2542
2543
its return value, a tuple of the original value and the differential, with
2543
- respect to its `x` argument. Since the return type contains a function,
2544
- [differentiation of higher- order functions](#differentiation - of- higher- order- functions)
2545
- is required for differentiating this differential operator .
2544
+ respect to its `x` argument.
2546
2545
2547
2546
A kneejerk solution is to differentiate derivative functions generated by the
2548
2547
differentiation transform at compile- time, but this leads to problems. For
0 commit comments