You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
using ForwardDiff: Dual, value
x1 = Dual.(1:4, 2:5, 3:6)
value.(float.(x1)) # Vector{Float16}
float.(value.(x1)) # Vector{Float64}
While one could argue that Julia should have different promotion / widening rules, it seems hard to argue that Dual types should disagree. This example caught me when trying to wrap a function which only accepts Float32 & Float64, as seems fairly common for C libraries.
I was surprised by this:
While one could argue that Julia should have different promotion / widening rules, it seems hard to argue that Dual types should disagree. This example caught me when trying to wrap a function which only accepts Float32 & Float64, as seems fairly common for C libraries.
Edit -- xref #419, about AbstractFloat.
And #362, about Int -> Float16. Example from here is
ForwardDiff.derivative(first∘sincos, 1) isa Float16
The text was updated successfully, but these errors were encountered: