Skip to content

Commit 27caf9b

Browse files
Merge pull request #377 from DhairyaLGandhi/dg/noproj
Remove projection rule for `VectorOfArray`
2 parents 53cd1ae + c51d5d1 commit 27caf9b

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

ext/RecursiveArrayToolsZygoteExt.jl

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -139,19 +139,6 @@ end
139139
view(A, I...), view_adjoint
140140
end
141141

142-
function ChainRulesCore.ProjectTo(a::AbstractVectorOfArray)
143-
ChainRulesCore.ProjectTo{VectorOfArray}((sz = size(a)))
144-
end
145-
146-
function (p::ChainRulesCore.ProjectTo{VectorOfArray})(x::Union{
147-
AbstractArray, AbstractVectorOfArray})
148-
if eltype(x) <: Number
149-
arr = reshape(x, p.sz)
150-
return VectorOfArray([arr[:, i] for i in 1:p.sz[end]])
151-
elseif eltype(x) <: AbstractArray
152-
return VectorOfArray(x)
153-
end
154-
end
155142

156143
@adjoint function Broadcast.broadcasted(::typeof(+), x::AbstractVectorOfArray,
157144
y::Union{Zygote.Numeric, AbstractVectorOfArray})

0 commit comments

Comments
 (0)