Skip to content

Commit cd68cd1

Browse files
committed
---
yaml --- r: 262139 b: refs/heads/tensorflow c: 6fb5f64 h: refs/heads/master i: 262137: 098756a 262135: 8c2c838
1 parent d5e3820 commit cd68cd1

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,7 @@ refs/tags/swift-DEVELOPMENT-SNAPSHOT-2018-04-25-a: 22f738a831d43aff2b9c9773bcb65
818818
refs/tags/swift-DEVELOPMENT-SNAPSHOT-2018-05-08-a: 7d98cc16689baba5c8a3b90a9329bdcc1a12b4e9
819819
refs/heads/cherr42: a566ad54b073c2c56ac0a705d0a5bed9743135a5
820820
"refs/heads/codable_test_comment_fix": fc8f6824f7f347e1e8db55bff62db385c5728b5a
821-
refs/heads/tensorflow: 96ad0c9a209d863d447ad95fb4c7f0fbd66bede6
821+
refs/heads/tensorflow: 6fb5f64d5669d4cf9b5add8737e502d90efd8a09
822822
refs/tags/swift-4.1-DEVELOPMENT-SNAPSHOT-2018-05-11-a: 8126fd7a652e2f70ad6d76505239e34fb2ef3e1a
823823
refs/tags/swift-4.1-DEVELOPMENT-SNAPSHOT-2018-05-12-a: b3fd3dd84df6717f2e2e9df58c6d7e99fed57086
824824
refs/tags/swift-4.1-DEVELOPMENT-SNAPSHOT-2018-05-13-a: 71135119579039dc321c5f65d870050fe36efda2

branches/tensorflow/stdlib/public/core/AutoDiff.swift

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,20 +59,18 @@ public protocol ShapedVectorNumeric : VectorNumeric {
5959
/// A type that mathematically represents a differentiable manifold whose
6060
/// tangent spaces are finite-dimensional.
6161
public protocol Differentiable {
62-
/// The tangent vector space of this differentiable manifold.
63-
associatedtype TangentVector : Differentiable & VectorNumeric
62+
/// The tangent bundle of this differentiable manifold.
63+
associatedtype TangentVector : Differentiable & AdditiveArithmetic
6464
// FIXME(SR-9595): Unexpected error when type checking constrained
6565
// associated types.
66-
where // TangentVector.Scalar : FloatingPoint,
67-
TangentVector.TangentVector == TangentVector,
66+
where TangentVector.TangentVector == TangentVector,
6867
TangentVector.CotangentVector == CotangentVector
6968

70-
/// The cotangent vector space of this differentiable manifold.
71-
associatedtype CotangentVector : Differentiable & VectorNumeric
69+
/// The cotangent bundle of this differentiable manifold.
70+
associatedtype CotangentVector : Differentiable & AdditiveArithmetic
7271
// FIXME(SR-9595): Unexpected error when type checking constrained
7372
// associated types.
74-
where // CotangentVector.Scalar : FloatingPoint,
75-
CotangentVector.TangentVector == CotangentVector,
73+
where CotangentVector.TangentVector == CotangentVector,
7674
CotangentVector.CotangentVector == TangentVector
7775

7876
/// Returns `self` moved along the value space towards the given tangent
@@ -84,11 +82,11 @@ public protocol Differentiable {
8482
func tangentVector(from cotangent: CotangentVector) -> TangentVector
8583
}
8684

87-
// FIXME: The `Self : VectorNumeric` constraint should be implied by
85+
// FIXME: The `Self : AdditiveArithmetic` constraint should be implied by
8886
// `TangentVector == Self`, but the type checker errors out when it does not
8987
// exist.
9088
public extension Differentiable
91-
where TangentVector == Self, Self : VectorNumeric {
89+
where TangentVector == Self, Self : AdditiveArithmetic {
9290
func moved(along direction: TangentVector) -> Self {
9391
return self + direction
9492
}

0 commit comments

Comments
 (0)