Tiny tiny thing.... So, I have some internal methods that process and cache prep for a gradient call. Right now I have to do this at the call site:
(val, grad) = if isnothing(prep)
value_and_gradient(f, backend, tree)
else
value_and_gradient(f, prep, backend, tree)
end
I think I would enjoy if DifferentiationInterface.jl did this routing for me. If prep=nothing I think it should be semantically identical to not passing prep at all.
Tiny tiny thing.... So, I have some internal methods that process and cache
prepfor a gradient call. Right now I have to do this at the call site:I think I would enjoy if DifferentiationInterface.jl did this routing for me. If
prep=nothingI think it should be semantically identical to not passing prep at all.