Skip to content

Commit b36a46b

Browse files
committed
Fix tag
1 parent 49de475 commit b36a46b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/utils.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ function default_adargs_to_adtype(; chunk_size = missing, autodiff = nothing,
5555
autodiff === missing && (autodiff = Val{true}())
5656

5757
ad = _unwrap_val(autodiff)
58-
tag = _unwrap_val(standardtag) ? NonlinearSolveTag() : nothing
59-
ad && return AutoForwardDiff{_unwrap_val(chunk_size), typeof(tag)}(tag)
58+
# We don't really know the typeof the input yet, so we can't use the correct tag!
59+
ad && return AutoForwardDiff{_unwrap_val(chunk_size), Nothing}(nothing)
6060
return AutoFiniteDiff(; fdtype = diff_type)
6161
end
6262

@@ -215,7 +215,7 @@ function __get_concrete_algorithm(alg, prob)
215215
# Use Finite Differencing
216216
use_sparse_ad ? AutoSparseFiniteDiff() : AutoFiniteDiff()
217217
else
218-
tag = NonlinearSolveTag()
218+
tag = ForwardDiff.Tag(NonlinearSolveTag(), eltype(prob.u0))
219219
(use_sparse_ad ? AutoSparseForwardDiff : AutoForwardDiff)(; tag)
220220
end
221221
return set_ad(alg, ad)

0 commit comments

Comments
 (0)