YingboMa / ForwardDiff2.jl

Other
52 stars 4 forks source link

Derivatives for mutating linear algebra #9

Open ChrisRackauckas opened 4 years ago

ChrisRackauckas commented 4 years ago

Things like mul! are important here, given the DualCache style of support. @oxinabox how should we be implementing derivatives for these? @jrevels mentioned that ChainRules.jl does have support for it. We need to basically say "check to make sure it's a dual of the right size, and then if so, use these mutating functions ..."

oxinabox commented 4 years ago

I have zero ideas for how ChainRules can be enhanced to support them. We need to sit down with @willtebbutt and @mikeinnes and think hard.

shashi commented 4 years ago

I might be stating the obvious because I'm just starting to think about this, I think the only way to do this is to use the fact that Dual is not user facing API. But we're allowed to do any program transform inside the dualrun context...

So some obvious things might get us going: