Open shashi opened 4 years ago
Found an MWE
using ModelingToolkit
@variables x
julia> cos(x) * Partials((1,))
1-element Array{Operation,1}:
cos(x) * 1
julia> 1.0 * Partials((1,))
1-element Partials{1,Float64}:
...
I think commutivity for scalar multiplication probably a requirement i am going to add to differentials, in ChainRules. Because noone wants to reason through this when writing rules. c.f. https://github.com/JuliaDiff/ChainRules.jl/pull/133
yeah yeah show fails (trying to do 2d access??) but that's not what I want to debug.
This is not a Partials array!! And a
Dual(x, p)
wherep
is a Partials array is not the same as whenp
is an Array, so this ruins everything.I suspect this is a Partials promotion problem and less sure that it's a ChainRules problem, so I'm opening this here and pinging @oxinabox