Skip to content

Commit 3a747d2

Browse files
committed
Make use of _checked_rrule in the rrule for map
1 parent 49e3a22 commit 3a747d2

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/rules/mapreduce.jl

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,7 @@ function rrule(::typeof(map), f, xs...)
77
∂xs = ntuple(length(xs)) do i
88
Rule() do
99
map(ȳ, xs...) do ȳi, xis...
10-
r = rrule(f, xis...)
11-
if r === nothing
12-
throw(ArgumentError("can't differentiate `map` with `$f`; no `rrule` " *
13-
"is defined for `$f$xis`"))
14-
end
15-
_, ∂xis = r
10+
_, ∂xis = _checked_rrule(f, xis...)
1611
extern(∂xis[i](ȳi))
1712
end
1813
end

0 commit comments

Comments
 (0)