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

Audit use of `zeros` vs `Zero`

Open oxinabox opened this issue 4 years ago • 3 comments

Some of the code used zero(X), or @thunk(zero(X)) I feel like if Zero is working right we should be able to replace that with Zero()

E.g. https://github.com/JuliaDiff/ChainRules.jl/blob/master/test/rules/linalg/factorization.jl

oxinabox avatar Sep 10 '19 11:09 oxinabox

Probably related to #46. Although we probably don't need the size information here.

simeonschaub avatar Sep 10 '19 11:09 simeonschaub

So that particular use-case is because we currently do not allow dervivatives that are NamedTuples to contain AbstractDifferentials for each element.

We probably should. We do need to give that whole case more thought still.

oxinabox avatar Sep 10 '19 13:09 oxinabox

  • https://github.com/JuliaDiff/ChainRules.jl/blob/3d2618e58dc55cf688e8570f97648ed9b4cb60f3/src/rulesets/LinearAlgebra/blas.jl#L8
  • https://github.com/JuliaDiff/ChainRules.jl/blob/3a1422c40e4915184561dce95f2e7a979b8dc5fa/test/rulesets/LinearAlgebra/factorization.jl#L34
  • https://github.com/JuliaDiff/ChainRules.jl/blob/3a1422c40e4915184561dce95f2e7a979b8dc5fa/test/rulesets/Base/base.jl#L114

nickrobinson251 avatar Jan 28 '20 13:01 nickrobinson251