Skip to content

Commit d654990

Browse files
committed
Fix tests: gradients for Int --> Float
1 parent 68bc950 commit d654990

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

test/autodiff_tests.jl

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,9 @@ truth = ComponentArray(a = [32, 48], x = 156)
3232
@test zygote_full truth
3333
end
3434

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
35+
@test ComponentArray(x=4.0,) Zygote.gradient(ComponentArray(x=2,)) do c
36+
(;c...,).x^2
37+
end[1]
4638

4739
# Issue #148
4840
ps = ComponentArray(;bias = rand(4))

0 commit comments

Comments
 (0)