Skip to content

Commit a87016e

Browse files
committed
docs: render EvalOptions in docs
1 parent 64c797c commit a87016e

File tree

3 files changed

+15
-10
lines changed

3 files changed

+15
-10
lines changed

docs/src/eval.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,10 @@ eval_tree_array(
1111
cX::AbstractMatrix{T},
1212
operators::OperatorEnum;
1313
eval_options::Union{EvalOptions,Nothing}=nothing,
14-
turbo::Union{Bool,Val,Nothing}=nothing,
15-
bumper::Union{Bool,Val,Nothing}=nothing,
1614
) where {T}
1715
```
1816

19-
Assuming you are only using a single `OperatorEnum`, you can also use
20-
the following shorthand by using the expression as a function:
17+
You can also use the following shorthand by using the expression as a function:
2118

2219
```
2320
(tree::AbstractExpressionNode)(X, operators::OperatorEnum; kws...)
@@ -59,6 +56,14 @@ It also re-defines `print`, `show`, and the various operators, to work with the
5956
Thus, if you define an expression with one `OperatorEnum`, and then try to
6057
evaluate it or print it with a different `OperatorEnum`, you will get undefined behavior!
6158

59+
For safer behavior, you should use [`Expression`](@ref) objects.
60+
61+
Evaluation options are specified using `EvalOptions`:
62+
63+
```@docs
64+
EvalOptions
65+
```
66+
6267
You can also work with arbitrary types, by defining a `GenericOperatorEnum` instead.
6368
The notation is the same for `eval_tree_array`, though it will return `nothing`
6469
when it can't find a method, and not do any NaN checks:

src/Evaluate.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ end
3131
"""
3232
EvalOptions{T,B,E}
3333
34-
EvalOptions contain flags for the different modes to evaluate an expression.
34+
This holds options for expression evaluation, such as evaluation backend.
3535
3636
# Fields
3737
38-
- `turbo::Val`: If `Val{true}`, use LoopVectorization.jl for faster
38+
- `turbo::Val{T}`: If `Val{true}`, use LoopVectorization.jl for faster
3939
evaluation.
40-
- `bumper::Val`: If `Val{true}, use Bumper.jl for faster evaluation.
41-
- `early_exit::Val`: If `Val{true}`, any element of any step becoming
40+
- `bumper::Val{B}`: If `Val{true}, use Bumper.jl for faster evaluation.
41+
- `early_exit::Val{E}`: If `Val{true}`, any element of any step becoming
4242
`NaN` or `Inf` will terminate the computation and the whole buffer will be
4343
returned with `NaN`s. This makes sure that expressions with singularities
4444
don't wast compute cycles. Setting `Val{false}` will continue the computation
@@ -101,7 +101,7 @@ and triplets of operations for lower memory usage.
101101
- `tree::AbstractExpressionNode`: The root node of the tree to evaluate.
102102
- `cX::AbstractMatrix{T}`: The input data to evaluate the tree on.
103103
- `operators::OperatorEnum`: The operators used in the tree.
104-
- `eval_options::Union{EvalOptions,Nothing}`: See EvalOptions for documenation
104+
- `eval_options::Union{EvalOptions,Nothing}`: See [`EvalOptions`](@ref) for documentation
105105
on the different evaluation modes.
106106
107107

src/Node.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ be performed with this assumption, to preserve structure of the graph.
142142
```julia
143143
julia> operators = OperatorEnum(;
144144
binary_operators=[+, -, *], unary_operators=[cos, sin]
145-
);
145+
);
146146
147147
julia> x = GraphNode(feature=1)
148148
x1

0 commit comments

Comments
 (0)