Closed
Description
I have been wanting to write something up on this for a while.
The kind of docs that are almost a blog post
This issue is to gather notes.
I think it is non-obvious that you do want to sometimes change the primal computation.
But you do sometimes, and in those times it is crucial that you can.
Its one of the features we have to support 1% of cases, which we really couldn't do as well if we didn't.
- Some examples and discussion of slightly different is here: https://forums.swift.org/t/agreement-of-valuewithdifferential-and-value/31869/11
- sincos for sin and cos use
sincos
in rules for sin and cos ChainRules.jl#291 - Prefactorizing for
\
and/
(Re)use factorizations in primal for \ etc in pullback ChainRules.jl#250 - simplifying the index for
getindex
Inplace getindex rrule ChainRules.jl#240 - More generally computing things like the primal input/output size etc, so as not to close over the whole thing