Skip to content

Commit

Permalink
error message and u0 bug
Browse files Browse the repository at this point in the history
  • Loading branch information
frankschae committed Jan 8, 2023
1 parent b692231 commit 410a469
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/adjoint_common.jl
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ function get_paramjac_config(autojacvec::EnzymeVJP, p, f, y, _p, _t; numindvar,
isRODE = nothing, _W = nothing)
if alg !== nothing && SciMLBase.forwarddiffs_model(alg)
chunk = if autojacvec.chunksize == 0
ForwardDiff.pickchunksize(length(u0))
ForwardDiff.pickchunksize(numindvar)
else
autojacvec.chunksize
end
Expand Down
3 changes: 2 additions & 1 deletion src/callback_tracking.jl
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,8 @@ function _setup_reverse_callbacks(cb::Union{ContinuousCallback, DiscreteCallback
# if save_positions = [1,0] the gradient contribution is added before, and in principle we would need to correct the adjoint state again. Thefore,

cb.save_positions == [1, 0] && error("save_positions=[1,0] is currently not supported.")
@assert sensealg.autojacvec isa Union{ReverseDiffVJP, EnzymeVJP}
!(sensealg.autojacvec isa Union{ReverseDiffVJP, EnzymeVJP}) &&
error("Only `ReverseDiffVJP` and `EnzymeVJP` are currently compatible with continuous adjoint sensitivity methods for hybrid DEs. Please select `ReverseDiffVJP` or `EnzymeVJP` as `autojacvec`.")

# event times
times = if typeof(cb) <: DiscreteCallback
Expand Down

0 comments on commit 410a469

Please sign in to comment.