Skip to content

Commit 85aa2fa

Browse files
committed
remove fallback unbroadcast method
1 parent 609196a commit 85aa2fa

File tree

1 file changed

+0
-15
lines changed

1 file changed

+0
-15
lines changed

src/rulesets/Base/broadcast.jl

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -372,21 +372,6 @@ function unbroadcast(f::Function, df)
372372
return sum(df)
373373
end
374374

375-
# Fallback
376-
377-
function unbroadcast(x, dx)
378-
@info "last unbroadcast method!" x dx
379-
dx isa AbstractZero && return dx
380-
p = ProjectTo(x)
381-
if p isa ProjectTo{<:AbstractZero}
382-
return NoTangent()
383-
elseif Broadcast.broadcastable(x) isa Ref # then x is scalar under broadcast
384-
return p(sum(dx))
385-
else
386-
error("don't know how to handle broadcast gradient for x::$(typeof(x))")
387-
end
388-
end
389-
390375
#####
391376
##### For testing
392377
#####

0 commit comments

Comments
 (0)