JuliaDiff / JuliaDiff/ReverseDiff.jl

Getindex of zero-array is ambiguous

Open
#126 0 comments 0 reactions 0 assignees View on GitHub

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.