1
- // RUN: %target-run-simple-swiftgyb
1
+ // RUN: %target-run-simple-swiftgyb(-Xfrontend -enable-experimental-forward-mode-differentiation)
2
2
// REQUIRES: executable_test
3
3
4
4
#if (arch(i386) || arch(x86_64)) && !os(Windows)
@@ -38,33 +38,24 @@ FloatingPointDerivativeTests.test("${Self}.+") {
38
38
expectEqual((1, 1), gradient(at: ${Self}(4), ${Self}(5), in: +))
39
39
expectEqual((10, 10), pullback(at: ${Self}(4), ${Self}(5), in: +)(${Self}(10)))
40
40
41
- // TODO(TF-1237): Upstream forward-mode differentiation.
42
- expectCrash {
43
- expectEqual(2, derivative(at: ${Self}(4), ${Self}(5), in: +))
44
- expectEqual(20, differential(at: ${Self}(4), ${Self}(5), in: +)(${Self}(10), ${Self}(10)))
45
- }
41
+ expectEqual(2, derivative(at: ${Self}(4), ${Self}(5), in: +))
42
+ expectEqual(20, differential(at: ${Self}(4), ${Self}(5), in: +)(${Self}(10), ${Self}(10)))
46
43
}
47
44
48
45
FloatingPointDerivativeTests.test("${Self}.-") {
49
46
expectEqual((1, -1), gradient(at: ${Self}(4), ${Self}(5), in: -))
50
47
expectEqual((10, -10), pullback(at: ${Self}(4), ${Self}(5), in: -)(${Self}(10)))
51
48
52
- // TODO(TF-1237): Upstream forward-mode differentiation.
53
- expectCrash {
54
- expectEqual(0, derivative(at: ${Self}(4), ${Self}(5), in: -))
55
- expectEqual(-5, differential(at: ${Self}(4), ${Self}(5), in: -)(${Self}(5), ${Self}(10)))
56
- }
49
+ expectEqual(0, derivative(at: ${Self}(4), ${Self}(5), in: -))
50
+ expectEqual(-5, differential(at: ${Self}(4), ${Self}(5), in: -)(${Self}(5), ${Self}(10)))
57
51
}
58
52
59
53
FloatingPointDerivativeTests.test("${Self}.*") {
60
54
expectEqual((5, 4), gradient(at: ${Self}(4), ${Self}(5), in: *))
61
55
expectEqual((50, 40), pullback(at: ${Self}(4), ${Self}(5), in: *)(${Self}(10)))
62
56
63
- // TODO(TF-1237): Upstream forward-mode differentiation.
64
- expectCrash {
65
- expectEqual(9, derivative(at: ${Self}(4), ${Self}(5), in: *))
66
- expectEqual(90, differential(at: ${Self}(4), ${Self}(5), in: *)(${Self}(10), ${Self}(10)))
67
- }
57
+ expectEqual(9, derivative(at: ${Self}(4), ${Self}(5), in: *))
58
+ expectEqual(90, differential(at: ${Self}(4), ${Self}(5), in: *)(${Self}(10), ${Self}(10)))
68
59
}
69
60
70
61
FloatingPointDerivativeTests.test("${Self}./") {
@@ -79,11 +70,8 @@ FloatingPointDerivativeTests.test("${Self}./") {
79
70
expectEqualWithTolerance(-1.6, dy)
80
71
}
81
72
82
- // TODO(TF-1237): Upstream forward-mode differentiation.
83
- expectCrash {
84
- expectEqualWithTolerance(0.04, derivative(at: ${Self}(4), ${Self}(5), in: /))
85
- expectEqual(90, differential(at: ${Self}(4), ${Self}(5), in: *)(${Self}(10), ${Self}(10)))
86
- }
73
+ expectEqualWithTolerance(0.04, derivative(at: ${Self}(4), ${Self}(5), in: /))
74
+ expectEqual(90, differential(at: ${Self}(4), ${Self}(5), in: *)(${Self}(10), ${Self}(10)))
87
75
}
88
76
89
77
FloatingPointDerivativeTests.test("${Self}.squareRoot") {
0 commit comments