JuliaDiff / JuliaDiff/DifferentiationInterface.jl
Allow `prep=nothing` to stand for "no preparation"
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 313
- Forks
- 35
- PR merge metrics
- No merged PRs in 30d
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the value_and_gradient entry points that accept prep and review how prepared and unprepared calls are tested. Add coverage showing that prep=nothing has the same behavior as omitting prep, then run the existing test suite to verify both routing paths.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- api
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100