Skip to content

Commit

Permalink
Disable more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
penelopeysm committed Nov 6, 2024
1 parent d3eafb2 commit 3f096f8
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions test/ad/flows.jl
Original file line number Diff line number Diff line change
@@ -1,32 +1,34 @@
@testset "PlanarLayer" begin
if v"1.11" <= VERSION < v"1.12"
broken = (:EnzymeForwardCrash,)
broken1 = (:EnzymeReverseCrash,)
broken2 = (:EnzymeForwardCrash, :EnzymeReverseCrash)
else
broken = ()
broken1 = ()
broken2 = ()
end

# logpdf of a flow with a planar layer and two-dimensional inputs
test_ad(randn(7)) do θ
test_ad(randn(7), broken1) 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), broken) do θ
test_ad(randn(11), broken2) do θ
layer = PlanarLayer(θ[1:2], θ[3:4], θ[5:5])
flow = transformed(MvNormal(zeros(2), I), layer)
x = reshape(θ[6:end], 2, :)
return sum(logpdf(flow.dist, x) - logabsdetjac(flow.transform, x))
end

# logpdf of a flow with the inverse of a planar layer and two-dimensional inputs
test_ad(randn(7)) do θ
test_ad(randn(7), broken1) do θ
layer = PlanarLayer(θ[1:2], θ[3:4], θ[5:5])
flow = transformed(MvNormal(zeros(2), I), inverse(layer))
x = θ[6:7]
return logpdf(flow.dist, x) - logabsdetjac(flow.transform, x)
end
test_ad(randn(11), broken) do θ
test_ad(randn(11), broken2) 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 3f096f8

Please sign in to comment.