Skip to content

Commit 9371ce3

Browse files
committed
Skipped new autodiff test for julia versions < 1.6
1 parent 0af590e commit 9371ce3

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

test/autodiff_tests.jl

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,15 @@ truth = [-400, 200]
3232
@test zygote_full.x truth
3333
end
3434

35-
@test ComponentArray(x=4,) == Zygote.gradient(ComponentArray(x=2,)) do c
36-
(;c...,).x^2
37-
end[1]
35+
# Not sure why this doesn't work in v1.2, but I don't want to drop the tests for that just
36+
# for this to work
37+
if VERSION v"1.6"
38+
@test ComponentArray(x=4,) == Zygote.gradient(ComponentArray(x=2,)) do c
39+
(;c...,).x^2
40+
end[1]
41+
else
42+
@test_skip ComponentArray(x=4,) == Zygote.gradient(ComponentArray(x=2,)) do c
43+
(;c...,).x^2
44+
end[1]
45+
end
3846
end

0 commit comments

Comments
 (0)