Added back for multi-parameter vcat

This commit is contained in:
GenaBitu 2017-12-08 16:10:09 +01:00
parent 41f3eedc39
commit 7e51418679
No known key found for this signature in database
GPG Key ID: 6E647E317A9DD426

View File

@ -39,10 +39,13 @@ Base.vcat(a::TrackedMatrix, b::TrackedMatrix) = TrackedArray(Call(vcat, a, b))
Base.vcat(a::TrackedMatrix, b::AbstractMatrix) = TrackedArray(Call(vcat, a, b)) Base.vcat(a::TrackedMatrix, b::AbstractMatrix) = TrackedArray(Call(vcat, a, b))
Base.vcat(a::AbstractMatrix, b::TrackedMatrix) = TrackedArray(Call(vcat, a, b)) Base.vcat(a::AbstractMatrix, b::TrackedMatrix) = TrackedArray(Call(vcat, a, b))
function back(::typeof(vcat), Δ, xs, ys) function back(::typeof(vcat), Δ, xs...)
i = Base.tail(map(_ -> :, size(Δ))) i = Base.tail(map(_ -> :, size(Δ)))
@back(xs, Δ[1:size(xs,1), i...]) start = 0
@back(ys, Δ[size(xs,1)+1:end, i...]) for xsi in xs
@back(xsi, Δ[start+1:start+size(xsi,1), i...])
start += size(xsi, 1)
end
end end
# Reductions # Reductions