-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Bijectors integration tests #353
Add Bijectors integration tests #353
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great, thank you for opening this.
Regarding the failing test: it's one that we know about already, and is related to this rather annoying upstream problem. We need some way of indicating that this is a problem. I propose the following:
- exclude the offending example from the main test suite
- call
build_rule
on the test case, which should be enough to trigger the error. Put this call inside a@test_broken
thing, so that when we eventually fix the problem we find out about it.
Does this sound sensible to you?
I put in the following, does this do what you wanted? TestCase(
function (x)
layer = Bijectors.PlanarLayer(x[1:2], x[3:4], x[5:5])
flow = Bijectors.transformed(
Bijectors.MvNormal(zeros(2), LinearAlgebra.I),
layer,
)
x = x[6:7]
return Bijectors.logpdf(flow.dist, x) -
Bijectors.logabsdetjac(flow.transform, x)
end,
randn(Xoshiro(23), 7);
name = "PlanarLayer7",
# TODO(mhauru) Broken on v1.11 due to
# https://github.com/compintell/Mooncake.jl/issues/319
broken=(VERSION >= v"1.11"),
), if case.broken
@test_broken begin
test_rule(Xoshiro(123456), case.func, case.arg; is_primitive=false)
true
end
else
test_rule(Xoshiro(123456), case.func, case.arg; is_primitive=false)
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is perfect. Thank you!
I'll merge when CI has passed. |
Copied over from EnzymeAD/Enzyme.jl#2037.
Closes #348