Skip to content
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

Fix invalid deterministic fform evaluation #185

Merged
merged 4 commits into from
Mar 19, 2024

Conversation

bvdmitri
Copy link
Member

This PR fixes cases where deterministic evaluation was invalid. E.g. in cases like

@model function broken_beta_bernoulli(y)
        θ ~ Matrix([1.0 0.0; 0.0 1.0])
        for i in eachindex(y)
            y[i] ~ Bernoulli(θ)
        end
    end

The Matrix([1.0 0.0; 0.0 1.0]) was evaluated and discarded. This PR fixes that, by allowing the evaluation of rhs only if the lhs is an anonymous variable. Such that this is still possible

θ ~ MvNormal(mean = zeros(2), covariance = Matrix([1.0 0.0; 0.0 1.0]))

@bvdmitri bvdmitri requested a review from wouterwln March 19, 2024 12:01
Copy link

codecov bot commented Mar 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.90%. Comparing base (54eb171) to head (21c7478).
Report is 13 commits behind head on dev-4.0.0.

Additional details and impacted files
@@              Coverage Diff              @@
##           dev-4.0.0     #185      +/-   ##
=============================================
+ Coverage      91.85%   91.90%   +0.04%     
=============================================
  Files             15       15              
  Lines           1842     1841       -1     
=============================================
  Hits            1692     1692              
+ Misses           150      149       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bvdmitri bvdmitri merged commit 20a9458 into dev-4.0.0 Mar 19, 2024
5 checks passed
@wouterwln wouterwln deleted the dev-engine-ignores-constant-nodes branch March 20, 2024 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants