-
Notifications
You must be signed in to change notification settings - Fork 154
Open
Description
in particular, this code seems really weird:
Lines 463 to 477 in 2263749
| for (M, f, arity) in DiffRules.diffrules(filter_modules = nothing) | |
| if (M, f) in ((:Base, :^), (:NaNMath, :pow), (:Base, :/), (:Base, :+), (:Base, :-), (:Base, :sin), (:Base, :cos)) | |
| continue # Skip methods which we define elsewhere. | |
| elseif !(isdefined(@__MODULE__, M) && isdefined(getfield(@__MODULE__, M), f)) | |
| continue # Skip rules for methods not defined in the current scope | |
| end | |
| if arity == 1 | |
| eval(unary_dual_definition(M, f)) | |
| elseif arity == 2 | |
| eval(binary_dual_definition(M, f)) | |
| else | |
| # error("ForwardDiff currently only knows how to autogenerate Dual definitions for unary and binary functions.") | |
| # However, the presence of N-ary rules need not cause any problems here, they can simply be ignored. | |
| end | |
| end |
in particular because NaNMath is loaded beforehand:
ForwardDiff.jl/src/ForwardDiff.jl
Line 10 in 2263749
| import NaNMath |
The same thing can be said about SpecialFunctions.
I noticed that DiffRules also depends on NaNMath and SpecialFunctions, but does not load those packages. ForwardDiff does.
Metadata
Metadata
Assignees
Labels
No labels