We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a8d416a commit 035e20aCopy full SHA for 035e20a
test/adjoints.jl
@@ -37,6 +37,11 @@ function loss6(x)
37
sum(abs2, Array(_prob.u0))
38
end
39
40
+function loss7(x)
41
+ _x = VectorOfArray([x .* i for i in 1:5])
42
+ return sum(abs2, x .- 1)
43
+end
44
+
45
x = float.(6:10)
46
loss(x)
47
@test Zygote.gradient(loss, x)[1] == ForwardDiff.gradient(loss, x)
@@ -45,3 +50,4 @@ loss(x)
50
@test Zygote.gradient(loss4, x)[1] == ForwardDiff.gradient(loss4, x)
51
@test Zygote.gradient(loss5, x)[1] == ForwardDiff.gradient(loss5, x)
52
@test Zygote.gradient(loss6, x)[1] == ForwardDiff.gradient(loss6, x)
53
+@test Zygote.gradient(loss7, x)[1] == ForwardDiff.gradient(loss7, x)
0 commit comments