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
ERROR: LoadError: LoadError: MethodError: no method matching rem2pi(::Int64, ::Float64)
Closest candidates are:
rem2pi(::Int64, ::RoundingMode) at math.jl:903
rem2pi(::ForwardDiff.Dual{Tx,V,N} where N where V<:Real, ::AbstractFloat) where Tx at /home/rdeits/Downloads/packages/v0.6/ForwardDiff/src/dual.jl:104
rem2pi(::Integer, ::ForwardDiff.Dual{Ty,V,N} where N where V<:Real) where Ty at /home/rdeits/Downloads/packages/v0.6/ForwardDiff/src/dual.jl:105
...
Stacktrace:
[1] rem2pi(::ForwardDiff.Dual{DualTest.TestTag(),Int64,1}, ::Float64) at /home/rdeits/Downloads/packages/v0.6/ForwardDiff/src/dual.jl:206
[2] macro expansion at /home/rdeits/Downloads/packages/v0.6/ForwardDiff/test/DualTest.jl:421 [inlined]
[3] anonymous at ./<missing>:?
[4] include_from_node1(::String) at ./loading.jl:576
[5] include(::String) at ./sysimg.jl:14
[6] include_from_node1(::String) at ./loading.jl:576
[7] include(::String) at ./sysimg.jl:14
[8] process_options(::Base.JLOptions) at ./client.jl:305
[9] _start() at ./client.jl:371
while loading /home/rdeits/Downloads/packages/v0.6/ForwardDiff/test/DualTest.jl, in expression starting on line 29
while loading /home/rdeits/Downloads/packages/v0.6/ForwardDiff/test/runtests.jl, in expression starting on line 10
There seem to be two issues here:
it looks like the unit test is trying to call rem2pi with two numeric arguments, which shouldn't work anyway
rem2pi seems to be treated as a generic binary numeric operation, so its Dual methods expect both arguments to be numbers or Duals, when in fact the second argument should be a rounding mode.
Simple reproduction of (2):
julia> ForwardDiff.derivative(x -> rem2pi(x, RoundUp), 1.0)
ERROR: MethodError: no method matching rem2pi(::ForwardDiff.Dual{ForwardDiff.Tag{##3#4,Float64},Float64,1}, ::RoundingMode{:Up})
Closest candidates are:
rem2pi(::Float64, ::RoundingMode{:Up}) at math.jl:870
rem2pi(::Float32, ::RoundingMode) at math.jl:899
rem2pi(::Float16, ::RoundingMode) at math.jl:900
...
Stacktrace:
[1] derivative(::##3#4, ::Float64) at /home/rdeits/Downloads/packages/v0.6/ForwardDiff/src/derivative.jl:14
Perhaps rem2pi doesn't really fit the DiffRules model and should be special-cased in ForwardDiff?
The unit tests currently fail on master with:
There seem to be two issues here:
rem2pi
with two numeric arguments, which shouldn't work anywayrem2pi
seems to be treated as a generic binary numeric operation, so itsDual
methods expect both arguments to be numbers or Duals, when in fact the second argument should be a rounding mode.Simple reproduction of (2):
Perhaps
rem2pi
doesn't really fit theDiffRules
model and should be special-cased in ForwardDiff?@tkoolen any thoughts?
The text was updated successfully, but these errors were encountered: