Closed andreasnoack closed 4 years ago
Still failing for me on NLSolversBase v7.6.0, Optim v0.20.0 and ForwardDiff v0.10.9.
Still failing for me on NLSolversBase v7.6.0, Optim v0.20.0 and ForwardDiff v0.10.9.
Sorry, I was not clear here, the "fix" was simply that you can supply the types yourself, but it still defaults to the old behavior. Although, as you showed, it didn't really for complex gradients :)
Ah ... I see. Thanks for the clarification.
In https://github.com/JuliaNLSolvers/NLSolversBase.jl/blob/12ceb15eb3c9ebc170f6d711ae73469a6b410e76/src/objective_types/twicedifferentiable.jl#L18,
similar(x)
is used for initialization of the gradient array but that need not be the right element type. In a nested derivative computation such asthe gradient will be a vector of duals which therefore causes an error.