Skip to content

Commit 2d6b9cd

Browse files
further simplify
1 parent c057729 commit 2d6b9cd

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

ext/RecursiveArrayToolsZygoteExt.jl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,15 @@ using RecursiveArrayTools
44

55
if isdefined(Base, :get_extension)
66
using Zygote
7-
using Zygote: FillArrays, literal_getproperty, @adjoint
7+
using Zygote: FillArrays, ChainRulesCore, literal_getproperty, @adjoint
88
else
99
using ..Zygote
10-
using ..Zygote: FillArrays, literal_getproperty, @adjoint
10+
using ..Zygote: FillArrays, ChainRulesCore, literal_getproperty, @adjoint
1111
end
1212

13+
# Define a new species of projection operator for this type:
14+
ChainRulesCore.ProjectTo(x::VectorOfArray) = ChainRulesCore.ProjectTo{VectorOfArray}()
15+
1316
@adjoint function getindex(VA::AbstractVectorOfArray, i::Int)
1417
function AbstractVectorOfArray_getindex_adjoint(Δ)
1518
Δ′ = [(i == j ? Δ : Fill(zero(eltype(x)), size(x)))

src/RecursiveArrayTools.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ include("utils.jl")
2020
include("vector_of_array.jl")
2121
include("tabletraits.jl")
2222
include("array_partition.jl")
23-
include("zygote.jl")
2423

2524
function Base.show(io::IO, x::Union{ArrayPartition, AbstractVectorOfArray})
2625
invoke(show, Tuple{typeof(io), Any}, io, x)

src/zygote.jl

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)