-
Notifications
You must be signed in to change notification settings - Fork 26
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
Inf
is treated as variable rather than data
#15
Comments
Reported by @jonasmac16. |
This is an interesting one, but may I ask how is supporting |
It's for something like below res = solve(...)
if res.success
data ~ dist
else
Inf ~ dist
end |
Can we achieve the same goal by defining the res = solve(...)
if res.success
data ~ dist
else
data ~ Impossible()
end Supporting |
Yes there are maily work aournds for this. Like the one you post or just pass in a data call |
Maybe standardize the compiler API for LHS with concrete values, by e.g. introducing a function operate on Julia expressions (which can be called by the |
Sounds good. |
As discussed in #57 (comment), I think the more natural way to write the example above would be res = solve(...)
if !res.success
@logpdf() = -Inf
return
end
data ~ dist So can this issue be closed, @xukai92, or are there other use cases that require a specific fix for |
It makes sense. The issue was originally rasied by a user in slack. Let's close if for now. |
In the MWE below,
Inf
is treated as a variable rather than the literalInf
.The text was updated successfully, but these errors were encountered: