FiniteDiff.jl
FiniteDiff.jl copied to clipboard
GradientCache typo?
The non-allocating GradientCache
constructor has a line that calls eltype(df)
, but I can't see df
anywhere in the arguments list?
https://github.com/JuliaDiffEq/DiffEqDiffTools.jl/blob/master/src/gradients.jl#L57 https://github.com/JuliaDiffEq/DiffEqDiffTools.jl/blob/master/README.md#allocating-cache-constructor
@dextorious / @ChrisRackauckas
I also think that the c1
etc. should be passed on to GradientCache
in these two functions.
https://github.com/JuliaDiffEq/DiffEqDiffTools.jl/blob/master/src/gradients.jl#L108
https://github.com/JuliaDiffEq/DiffEqDiffTools.jl/blob/master/src/gradients.jl#L134
Or have I misunderstood something here?
Hmm, I made a change to c1
but does it actually need to be required here?
Hmm, I made a change to c1 but does it actually need to be required here?
Thanks. There's also a reference to df
on this line https://github.com/JuliaDiffEq/DiffEqDiffTools.jl/blob/master/src/gradients.jl#L72
I don't know what is needed and not, but it seems like a test calling the non-allocating GradientCache must be missing if the tests pass?
BTW: We don't use these constructors and methods in Optim, so all is good from our side. I just thought I should mention that something looks weird here.
Yeah, the tests are using the allocating cache. That last one was created hastily at the end it needs fixing. Optim shouldn't require either though since it should have an empty cache for R^n -> R gradients.