ForwardDiff.jl
ForwardDiff.jl copied to clipboard
Relax type signatures on multiplication with partials
We need this for TPU work so that things like XRTArrays can be multiplied in.
We need some versions of these methods with some type restrictions to avoid inevitable ambiguity warnings:
...testing Partials{3,Int64}
Error During Test at /home/travis/build/JuliaDiff/ForwardDiff.jl/test/PartialsTest.jl:111
Test threw exception
Expression: X * PARTIALS == PARTIALS * X
MethodError: *(::Float64, ::ForwardDiff.Partials{3,Int64}) is ambiguous. Candidates:
*(x, partials::ForwardDiff.Partials) in ForwardDiff at /home/travis/build/JuliaDiff/ForwardDiff.jl/src/partials.jl:84
*(A::Number, B::AbstractArray) in Base at arraymath.jl:52
Possible fix, define
*(::Number, ::ForwardDiff.Partials)
Would be nice to just replace Partials with StaticVectors entirely sometime soon since we've already taken on StaticArrays as a dependency