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
The order of the parameters for the Partial type are {N,T} while for AbstractArray they are {T,N}. This leads to some confusion, for example, trying to print a partial type now gives:
julia> ForwardDiff.Dual(1, (2,3)).partials
2-element ForwardDiff.Partials{2,Int64}:
Error showing value of type ForwardDiff.Partials{2,Int64}:------ MethodError --------------------- Stacktrace (most recent call last)
....
[6] — print_response(::Base.REPL.LineEditREPL, ::Any, ::Void, ::Bool, ::Bool) at REPL.jl:139
[7] — print_response(::Base.Terminals.TTYTerminal, ::Any, ::Void, ::Bool, ::Bool, ::Void) at REPL.jl:154
[8] — display(::ForwardDiff.Partials{2,Int64}) at multimedia.jl:143
[9] — display(::Base.REPL.REPLDisplay{Base.REPL.LineEditREPL}, ::ForwardDiff.Partials{2,Int64}) at REPL.jl:135
[10] — display(::Base.REPL.REPLDisplay{Base.REPL.LineEditREPL}, ::MIME{Symbol("text/plain")}, ::ForwardDiff.Partials{2,Int64}) at REPL.jl:132
[11] — #showarray#330(::Bool, ::Function, ::IOContext{Base.Terminals.TTYTerminal}, ::ForwardDiff.Partials{2,Int64}, ::Bool) at show.jl:1617
MethodError: no method matching isless(::Int64, ::Type{Int64})
Closest candidates are:isless(::Real, ::AbstractFloat) at operators.jl:41isless(::Real, ::ForwardDiff.Dual{N,T<:Real}) at /home/kristoffer/.julia/v0.5/ForwardDiff/src/dual.jl:130isless(::Real, ::Real) at operators.jl:75...
This is because of ndims{T,N}(::AbstractArray{T,N}) = N in Base picking the wrong parameter. Maybe the parameters should be swapped? Implementing this function specifically for Partials, errors out in other places.
Activity
fix #161
jrevels commentedon Dec 2, 2016
Yeah, that
Nis a typo.Partialsshould just be a subtype ofAbstractVector. Thanks for catching this.fix #161
Fix incorrect Partials supertype relation and Config chunk size asser…