Closed mcabbott closed 2 years ago
Merging #116 (6774742) into main (7bc3e67) will not change coverage. The diff coverage is
100.00%
.
@@ Coverage Diff @@
## main #116 +/- ##
=======================================
Coverage 85.41% 85.41%
=======================================
Files 9 9
Lines 473 473
=======================================
Hits 404 404
Misses 69 69
Impacted Files | Coverage Δ | |
---|---|---|
src/helpers.jl | 54.68% <100.00%> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 7bc3e67...6774742. Read the comment docs.
I'm surprised ChainRules didn't have a rule for this. See whether you think https://github.com/JuliaDiff/ChainRules.jl/pull/643 looks OK?
JuliaDiff/ChainRules.jl#643 definitely looks like the way to go for getindex(::Tuple)
. If I don't miss anything, I guess the optimal solution is to merge that PR and modify this one to only keep the test, right?
Also, I only see getindex(::Array)
and not getindex(::AbstractArray)
in ChainRules. Do you know if it's intended?
I think one hope might have been that indexing of (say) a transposed array ultimately calls getindex(::Array)
, so a rule only for that might ultimately compose well. But taking a slice of A'
then needs to wait until it resolves to scalar indexing of A
, so the AD is going to have to handle many more operations. Having getindex(::AbstractArray)
is probably a better fit for present AD, and ChainRules 1.0.
Then I'm going to merge this PR, but not remove Yota-specific rules for getindex(::AbstractArray)
yet.
I'll be happy to switch to CR for tuples once JuliaDiff/ChainRules.jl#643 is merged though.
This wants to fix the following error:
After: