We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a7db825 commit 4a90b1dCopy full SHA for 4a90b1d
ext/RecursiveArrayToolsZygoteExt.jl
@@ -99,6 +99,17 @@ end
99
end
100
101
102
+Zygote.@adjoint function Zygote.literal_getproperty(A::RecursiveArrayTools.VectorOfArray, ::Val{:u})
103
+ function literal_VectorOfArray_x_adjoint(d)
104
+ m = map(enumerate(d)) do (idx, d_i)
105
+ isnothing(d_i) && return zero(A.u[idx])
106
+ d_i
107
+ end
108
+ (VectorOfArray(m),nothing)
109
110
+ A.u, literal_VectorOfArray_x_adjoint
111
+end
112
+
113
@adjoint function literal_getproperty(A::ArrayPartition, ::Val{:x})
114
function literal_ArrayPartition_x_adjoint(d)
115
(ArrayPartition((isnothing(d[i]) ? zero(A.x[i]) : d[i] for i in 1:length(d))...),)
0 commit comments