Skip to content

Commit 93d2c48

Browse files
test: check getproperty(, :u) returns VectorOfArray
1 parent 4a90b1d commit 93d2c48

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/adjoints.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,9 @@ loss(x)
9292
VectorOfArray([collect((3i):(3i + 3)) for i in 1:5])
9393
@test Zygote.gradient(loss10, x)[1] == ForwardDiff.gradient(loss10, x)
9494
@test Zygote.gradient(loss11, x)[1] == ForwardDiff.gradient(loss11, x)
95+
96+
voa = RecursiveArrayTools.VectorOfArray(fill(rand(3), 3))
97+
voa_gs, = Zygote.gradient(voa) do x
98+
sum(sum.(x.u))
99+
end
100+
@test voa_gs isa RecursiveArrayTools.VectorOfArray

0 commit comments

Comments
 (0)