ChainRules.jl
ChainRules.jl copied to clipboard
(Re)use factorizations in primal for \ etc in pullback
Transferred from https://github.com/FluxML/Zygote.jl/issues/773
There are some adjoints which repeat calculations in the backwards pass which can be avoided, for example.
https://github.com/JuliaDiff/ChainRules.jl/blob/bb08bd80b5cee92947002547de1f54556a5e3ee7/src/rulesets/LinearAlgebra/dense.jl#L284-L310 This refactorizes A' and can be replaced with factorize and use that in the backwards pass
Cc @oxinabox