You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/index.md
+10-18Lines changed: 10 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -56,14 +56,11 @@ The call will test the `frule` for function `f` at the point `x` in the domain.
56
56
Keep this in mind when testing discontinuous rules for functions like [ReLU](https://en.wikipedia.org/wiki/Rectifier_(neural_networks)), which should ideally be tested at both `x` being above and below zero.
@@ -72,12 +69,9 @@ Test.DefaultTestSet("test_frule: two2three at (3.33, -7.77)", Any[Test.DefaultTe
72
69
The call will test the `rrule` for function `f` at the point `x`, and similarly to `frule` some rules should be tested at multiple points in the domain.
73
70
74
71
```jldoctest ex; output = false
75
-
test_rrule(two2three, 3.33, -7.77);
76
-
77
-
# output
78
-
Test Summary: | Pass Total
79
-
test_rrule: two2three at (3.33, -7.77) | 6 6
80
-
Test.DefaultTestSet("test_rrule: two2three at (3.33, -7.77)", Any[Test.DefaultTestSet("Don't thunk only non_zero argument", Any[], 0, false)], 6, false)
72
+
julia> test_rrule(two2three, 3.33, -7.77);
73
+
Test Summary: | Pass Total
74
+
test_rrule: two2three on Float64,Float64 | 6 6
81
75
```
82
76
83
77
## Scalar example
@@ -102,15 +96,13 @@ with the `frule` and `rrule` defined with the help of `@scalar_rule` macro
102
96
`test_scalar` function is provided to test both the `frule` and the `rrule` with a single
103
97
call.
104
98
```jldoctest ex; output = false
105
-
test_scalar(relu, 0.5);
106
-
test_scalar(relu, -0.5);
107
-
108
-
# output
99
+
julia> test_scalar(relu, 0.5);
109
100
Test Summary: | Pass Total
110
101
test_scalar: relu at 0.5 | 7 7
102
+
103
+
julia> test_scalar(relu, -0.5);
111
104
Test Summary: | Pass Total
112
105
test_scalar: relu at -0.5 | 7 7
113
-
Test.DefaultTestSet("test_scalar: relu at -0.5", Any[Test.DefaultTestSet("with tangent 1.0", Any[Test.DefaultTestSet("test_frule: relu at (ChainRulesTestUtils.PrimalAndTangent{Float64,Float64}(-0.5, 1.0),)", Any[], 3, false)], 0, false), Test.DefaultTestSet("with cotangent 1.0", Any[Test.DefaultTestSet("test_rrule: relu at (ChainRulesTestUtils.PrimalAndTangent{Float64,Float64}(-0.5, 1.0),)", Any[Test.DefaultTestSet("Don't thunk only non_zero argument", Any[], 0, false)], 4, false)], 0, false)], 0, false)
0 commit comments