Skip to content

Commit b792772

Browse files
committed
let nothing through
1 parent c3209f4 commit b792772

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/compiler/chainrules.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ Safe to apply to arbitrary input.
139139
@inline function _project(x::Union{Numeric, Ref{<:Numeric}}, dx)
140140
wrap_chainrules_output(ProjectTo(x)(wrap_chainrules_input(dx)))
141141
end
142-
_project(x::AbstractArray, dx) = reshape(dx, axes(x))
142+
_project(x::AbstractArray, dx) = dx isa AbstractArray ? reshape(dx, axes(x)) : dx
143143
_project(x, dx) = dx
144144

145145
# Restore splatted arrays

0 commit comments

Comments
 (0)