File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -391,8 +391,9 @@ FiniteDiff.GradientCache(
391391Note that here ` fx ` is a cached function call of ` f ` . If you provide ` fx ` , then
392392` fx ` will be used in the forward differencing method to skip a function call.
393393It is on you to make sure that you update ` cache.fx ` every time before
394- calling ` FiniteDiff.finite_difference_gradient! ` . A good use of this is if you have a
395- cache array for the output of ` fx ` already being used, you can make it alias
394+ calling ` FiniteDiff.finite_difference_gradient! ` . If ` fx ` is an immutable, e.g. a scalar or
395+ a ` StaticArray ` , ` cache.fx ` should be updated using ` @set ` from [ Setfield.jl] ( https://github.com/jw3126/Setfield.jl ) .
396+ A good use of this is if you have a cache array for the output of ` fx ` already being used, you can make it alias
396397into the differencing algorithm here.
397398
398399## Jacobians
You can’t perform that action at this time.
0 commit comments