ChainRules.jl icon indicating copy to clipboard operation
ChainRules.jl copied to clipboard

WIP: Make getindex work for arrays with any eltype

Open oxinabox opened this issue 5 years ago • 0 comments

This is split off ove #240

@willtebbutt said here https://github.com/JuliaDiff/ChainRules.jl/pull/240#issuecomment-710493909

This broadly LGTM. It would be good to add some tests involving arrays with an element type that's not a number -- perhaps an array of arrays?

Turns out this is much harder than i thought. Finding zeros is annoying Splitting it into its own PR so not to block other more important things

I think this is right but it could be better and also: ChainRulesTestUtils freaks out at these tests.

I know one bit to fix it is to do LinearAlgebra.norm(::Zero) = 0.0 I think another might be to stop using isapprox directly on arbitary types

One thing that makes it a bit more annoying is: https://github.com/JuliaLang/julia/issues/38064

oxinabox avatar Oct 16 '20 20:10 oxinabox