Skip to content

Commit 909192c

Browse files
authored
Merge pull request #28721 from rxwei/differentiable-programming-doc-fix
2 parents b6f778d + fb38f92 commit 909192c

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

docs/DifferentiableProgramming.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2016,10 +2016,11 @@ differentiating either one will provide derivatives with respect to parameters
20162016
`T` and `U`. Here are some examples of first-order function types and their
20172017
corresponding curried function types:
20182018

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` |
20232024

20242025
A curried differentiable function can be formed like any curried
20252026
non-differentiable function in Swift.
@@ -2540,9 +2541,7 @@ func valueWithDifferential<T: FloatingPoint, U: Differentiable>(
25402541

25412542
To differentiate `valueWithDifferential`, we need to be able to differentiate
25422543
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.
25462545

25472546
A kneejerk solution is to differentiate derivative functions generated by the
25482547
differentiation transform at compile-time, but this leads to problems. For

0 commit comments

Comments
 (0)