Skip to content

Commit 6f3eefa

Browse files
committed
two broken tests
1 parent af14f84 commit 6f3eefa

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/destructure.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ end
5656
@test g6.a == [0,0,0]
5757
@test g6.a isa Vector{Float64}
5858
@test g6.b == [0+im]
59+
60+
# Second derivative -- no method matching rrule(::typeof(Optimisers._rebuild), ...?
61+
@test_broken gradient([1,2,3]) do v
62+
sum(abs2, gradient(m -> sum(abs2, destructure(m)[1]), (v, [4,5,6]))[1][1])
63+
end[1] [8,16,24]
5964
end
6065

6166
@testset "gradient of rebuild" begin
@@ -79,6 +84,11 @@ end
7984
@test gradient(x -> re7(x).a[2][3], rand(3))[1] == [0,0,1]
8085
@test gradient(x -> re7(x).b[2][2], rand(3))[1] == [0,0,0]
8186
@test gradient(x -> re7(x).c[2][1], rand(3))[1] == [0,0,0]
87+
88+
# Second derivative -- error from _tryaxes(x::Tangent) in Zygote's map rule
89+
@test_broken gradient(collect(1:6)) do y
90+
sum(abs2, gradient(x -> sum(abs2, re2(x)[1]), y)[1])
91+
end[1] [8,16,24,0,0,0]
8292
end
8393

8494
@testset "Flux issue 1826" begin

0 commit comments

Comments
 (0)