JuliaDiff / JuliaDiff/ReverseDiff.jl
Getindex of zero-array is ambiguous
Open
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 393
- Forks
- 60
- Avg merge
- 18h 24m
- Merged PRs (30d)
- 8
Description
Minimal example:
julia> ReverseDiff.gradient(x -> x[], fill(1.0))
ERROR: MethodError: getindex(::ReverseDiff.TrackedArray{Float64,Float64,0,Array{Float64,0},Array{Float64,0}}) is ambiguous. Candidates:
getindex(t::ReverseDiff.TrackedArray, i::AbstractRange...) in ReverseDiff at /Users/me/.julia/packages/ReverseDiff/uy0uk/src/tracked.jl:284
getindex(t::ReverseDiff.TrackedArray, i::Colon...) in ReverseDiff at /Users/me/.julia/packages/ReverseDiff/uy0uk/src/tracked.jl:284
Possible fix, define
getindex(::ReverseDiff.TrackedArray)
Contributor guide
No contributing guide indexed for this repository
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 with the getindex definitions at src/tracked.jl:284 and reproduce the ambiguity using the Julia ReverseDiff.gradient example in the issue. The work is done when zero-dimensional TrackedArray indexing is no longer ambiguous and the example succeeds.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100