Skip to content

Commit 48d45dc

Browse files
committed
fix incorrected frule fallback
1 parent 9bf7935 commit 48d45dc

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

src/ruleset_loading.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ function _rule_list end
5858
_rule_list(rule_kind) = (m for m in methods(rule_kind) if !_is_fallback(rule_kind, m))
5959

6060
"check if this is the fallback-frule/rrule that always returns `nothing`"
61-
_is_fallback(rule_kind, m::Method) = m.sig === Tuple{typeof(rule_kind), Any, Vararg{Any}}
61+
_is_fallback(::typeof(rrule), m::Method) = m.sig === Tuple{typeof(rrule),Any,Vararg{Any}}
62+
_is_fallback(::typeof(frule), m::Method) = m.sig === Tuple{typeof(frule),Any,Any,Vararg{Any}}
6263

6364
const LAST_REFRESH_RRULE = Ref(0)
6465
const LAST_REFRESH_FRULE = Ref(0)

test/ruleset_loading.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,6 @@
7373
@testset "_is_fallback" begin
7474
_is_fallback = ChainRulesOverloadGeneration._is_fallback
7575
@test _is_fallback(rrule, first(methods(rrule, (Nothing,))))
76-
@test _is_fallback(frule, first(methods(frule, (Nothing,))))
76+
@test _is_fallback(frule, first(methods(frule, (Tuple{}, Nothing,))))
7777
end
7878
end

0 commit comments

Comments
 (0)