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
make it easier to find out what ⊢is and how to type it (#216)
* make it easier to find out what ⊢is and how to type it
* more edits
* try
* try again
* apparently referring to unicode operators is really difficult
* a bit more editing of docstrings
[`test_frule`](@ref) and [`test_rrule`](@ref) allow you to specify the tangents used for testing.
137
-
This is done by passing in `x ⊢ Δx`, where `x` is the primal and `Δx` is the tangent, in the place of the primal inputs.
138
-
If this is not done the tangent will be automatically generated via `FiniteDifferences.rand_tangent`.
137
+
By default, tangents will be automatically generated via `FiniteDifferences.rand_tangent`.
138
+
To explicitly specify a tangent, pass in `x ⊢ Δx`, where `x` is the primal and `Δx` is the tangent, in the place of the primal inputs.
139
+
(You can enter [`⊢`](@ref) via `\vdash` + tab in the Julia REPL and supporting editors.)
139
140
A special case of this is that if you specify it as `x ⊢ NoTangent()` then finite differencing will not be used on that input.
140
141
Similarly, by setting the `output_tangent` keyword argument, you can specify the tangent for the primal output.
141
142
142
143
This can be useful when the default provided `FiniteDifferences.rand_tangent` doesn't produce the desired tangent for your type.
143
-
For example the default tangent for an `Int` is `NoTangent()`.
144
-
Which is correct e.g. when the `Int` represents a discrete integer like in indexing.
144
+
For example, the default tangent for an `Int` is `NoTangent()`, which is correct e.g. when the `Int` represents a discrete integer like in indexing.
145
145
But if you are testing something where the `Int` is actually a special case of a real number, then you would want to specify the tangent as a `Float64`.
146
146
147
147
Care must be taken when manually specifying tangents.
This behavior can also be overridden globally by setting the environment variable `CHAINRULES_TEST_INFERRED` before ChainRulesTestUtils is loaded or by changing `ChainRulesTestUtils.TEST_INFERRED[]` from inside Julia.
276
-
ChainRulesTestUtils can detect whether a test is run as part of [PkgEval](https://github.com/JuliaCI/PkgEval.jl)and in this case disables inference tests automatically. Packages can use [`@maybe_inferred`](@ref) to get the same behavior for other inference tests.
276
+
ChainRulesTestUtils can detect whether a test is run as part of [PkgEval](https://github.com/JuliaCI/PkgEval.jl)and in this case disables inference tests automatically. Packages can use [`@maybe_inferred`](@ref) to get the same behavior for other inference tests.
0 commit comments