Skip to content

Commit

Permalink
Un-re-enable 1.11 Enzyme tests
Browse files Browse the repository at this point in the history
  • Loading branch information
penelopeysm committed Nov 6, 2024
1 parent 044775f commit d3eafb2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions test/Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[deps]
AbstractMCMC = "80f14c24-f653-4e6a-9b94-39d6b0f70001"
AdvancedHMC = "0bf59076-c3b1-5ca4-86bd-e02cd72cde3d"
Bijectors = "76274a88-744f-5084-9051-94815aaf08c4"
ChainRulesTestUtils = "cdddcdb0-9152-4a09-a978-84456f9df70a"
ChangesOfVariables = "9e997f8a-9a97-42d5-a9f1-ce6bfc15e2c0"
Combinatorics = "861a8166-3701-5b0c-9a16-15d98fcdc6aa"
Expand Down
12 changes: 8 additions & 4 deletions test/ad/flows.jl
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
@testset "PlanarLayer" begin
# TODO(mhauru) Remove the EnzymeReverse marks once this has been fixed:
# https://github.com/EnzymeAD/Enzyme.jl/issues/2030
if v"1.11" <= VERSION < v"1.12"
broken = (:EnzymeForwardCrash,)
else
broken = ()
end

# logpdf of a flow with a planar layer and two-dimensional inputs
test_ad(randn(7)) do θ
layer = PlanarLayer(θ[1:2], θ[3:4], θ[5:5])
flow = transformed(MvNormal(zeros(2), I), layer)
x = θ[6:7]
return logpdf(flow.dist, x) - logabsdetjac(flow.transform, x)
end
test_ad(randn(11)) do θ
test_ad(randn(11), broken) do θ
layer = PlanarLayer(θ[1:2], θ[3:4], θ[5:5])
flow = transformed(MvNormal(zeros(2), I), layer)
x = reshape(θ[6:end], 2, :)
Expand All @@ -22,7 +26,7 @@
x = θ[6:7]
return logpdf(flow.dist, x) - logabsdetjac(flow.transform, x)
end
test_ad(randn(11)) do θ
test_ad(randn(11), broken) do θ
layer = PlanarLayer(θ[1:2], θ[3:4], θ[5:5])
flow = transformed(MvNormal(zeros(2), I), inverse(layer))
x = reshape(θ[6:end], 2, :)
Expand Down

0 comments on commit d3eafb2

Please sign in to comment.