Skip to content

Commit

Permalink
Pass order of derivative as Val()
Browse files Browse the repository at this point in the history
  • Loading branch information
facusapienza21 authored and tansongchen committed Nov 19, 2024
1 parent 555210e commit 3827867
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ TaylorDiff.jl is fast! See our dedicated [benchmarks](https://benchmark.tansongc
using TaylorDiff

x = 0.1
derivative(sin, x, 10) # scalar derivative
derivative(sin, x, Val(10)) # scalar derivative
v, direction = [3.0, 4.0], [1.0, 0.0]
derivative(x -> sum(exp.(x)), v, direction, 2) # directional derivative
derivative(x -> sum(exp.(x)), v, direction, Val(2)) # directional derivative
```

Please see our [documentation](https://juliadiff.org/TaylorDiff.jl) for more details.
Expand Down
4 changes: 2 additions & 2 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ TaylorDiff.jl is fast! See our dedicated [benchmarks](https://benchmark.tansongc
using TaylorDiff

x = 0.1
derivative(sin, x, 10) # scalar derivative
derivative(sin, x, Val(10)) # scalar derivative
v, direction = [3.0, 4.0], [1.0, 0.0]
derivative(x -> sum(exp.(x)), v, direction, 2) # directional derivative
derivative(x -> sum(exp.(x)), v, direction, Val(2)) # directional derivative
```

Please see our [documentation](https://juliadiff.org/TaylorDiff.jl) for more details.
Expand Down
2 changes: 1 addition & 1 deletion examples/ode.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ display(different_time(ic, p_true, 2e-5))
display(just_t(0.5))

#display(ForwardDiff.derivative(just_t,1.0))
display(TaylorDiff.derivative(just_t, 1.0, 1)) #isnan error
display(TaylorDiff.derivative(just_t, 1.0, Val(1))) #isnan error
#display(value_and_gradient(just_t, AutoForwardDiff(), 1.0))
#display(value_and_gradient(just_t, AutoReverseDiff(), 1.0))
#display(value_and_gradient(just_t, AutoEnzyme(Enzyme.Reverse), 1.0))
Expand Down

0 comments on commit 3827867

Please sign in to comment.