@@ -971,21 +971,20 @@ public protocol Differentiable {
971
971
972
972
/// A closure that produces a zero tangent vector and does not capture `self`.
973
973
///
974
- /// A zero tangent vector of `self` is equal to `TangentVector.zero`
975
- /// sometimes. In some cases, the zero tangent vector dependes on
976
- /// information on `self`, such as shape. For differentiable programming, it
977
- /// is more memory-efficient to define a custom
978
- /// `zeroTangentVectorInitializer` to return a closure that captures and
979
- /// uses such information to create a zero tangent vector. For example:
974
+ /// In some cases, the zero tangent vector of `self` is equal to
975
+ /// `TangentVector.zero`. In other cases, the zero tangent vector depends on
976
+ /// information in `self`, such as shape for an n-dimensional array type.
977
+ /// For differentiable programming, it is more memory-efficient to define a
978
+ /// custom `zeroTangentVectorInitializer` property which returns a closure
979
+ /// that captures and uses only the necessary information to create a zero
980
+ /// tangent vector. For example:
980
981
///
981
982
/// ```swift
982
983
/// struct Vector {
983
- /// var scalars: [Float]
984
- /// var count: Int { scalars.count }
985
- /// init(repeating repeatedElement: Float, count: Int) { ... }
984
+ /// var scalars: [Float]
985
+ /// var count: Int { scalars.count }
986
+ /// init(repeating repeatedElement: Float, count: Int) { ... }
986
987
/// }
987
- ///
988
- /// ...
989
988
///
990
989
/// extension Vector: Differentiable {
991
990
/// typealias TangentVector = Vector
0 commit comments