Skip to content

Commit

Permalink
Fix after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
jgreener64 committed Nov 26, 2023
1 parent bd4b40b commit 7de6433
Showing 1 changed file with 1 addition and 54 deletions.
55 changes: 1 addition & 54 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2592,60 +2592,6 @@ end
end
end

@testset "Linear Solve" begin
A = Float64[2 3; 5 7]
dA = zero(A)
b = Float64[11, 13]
db = zero(b)

forward, pullback = Enzyme.autodiff_thunk(ReverseSplitNoPrimal, Const{typeof(\)}, Duplicated, Duplicated{typeof(A)}, Duplicated{typeof(b)})

tape, primal, shadow = forward(Const(\), Duplicated(A, dA), Duplicated(b, db))

dy = Float64[17, 19]
copyto!(shadow, dy)

pullback(Const(\), Duplicated(A, dA), Duplicated(b, db), tape)

z = transpose(A) \ dy

y = A \ b
@test dA (-z * transpose(y))
@test db z

db = zero(b)

forward, pullback = Enzyme.autodiff_thunk(ReverseSplitNoPrimal, Const{typeof(\)}, Duplicated, Const{typeof(A)}, Duplicated{typeof(b)})

tape, primal, shadow = forward(Const(\), Const(A), Duplicated(b, db))

dy = Float64[17, 19]
copyto!(shadow, dy)

pullback(Const(\), Const(A), Duplicated(b, db), tape)

z = transpose(A) \ dy

y = A \ b
@test db z

dA = zero(A)

forward, pullback = Enzyme.autodiff_thunk(ReverseSplitNoPrimal, Const{typeof(\)}, Duplicated, Duplicated{typeof(A)}, Const{typeof(b)})

tape, primal, shadow = forward(Const(\), Duplicated(A, dA), Const(b))

dy = Float64[17, 19]
copyto!(shadow, dy)

pullback(Const(\), Duplicated(A, dA), Const(b), tape)

z = transpose(A) \ dy

y = A \ b
@test dA (-z * transpose(y))
end

@static if VERSION >= v"1.7-"
@testset "hvcat_fill" begin
ar = Matrix{Float64}(undef, 2, 3)
Expand All @@ -2661,3 +2607,4 @@ end
@test res[2][6] 6.0
end
end

0 comments on commit 7de6433

Please sign in to comment.