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

Add default implementations of assume and dot_assume #682

Open
penelopeysm opened this issue Oct 7, 2024 · 1 comment
Open

Add default implementations of assume and dot_assume #682

penelopeysm opened this issue Oct 7, 2024 · 1 comment

Comments

@penelopeysm
Copy link
Member

cf. TuringLang/Turing.jl#2360 (comment)

dot_assume's fallback method is here:

function dot_assume(rng, spl::Sampler, ::Any, ::AbstractArray{<:VarName}, ::Any, ::Any)
return error(
"[DynamicPPL] $(alg_str(spl)) doesn't support vectorizing assume statement"
)
end

As far as I can tell assume doesn't have a fallback method so that would just need to be added.

@torfjelde
Copy link
Member

IMO we should do this for all the methods.

Most samplers which are currently overloading the tilde-pipeline does so only to call updategid! and then nothing else (compared to SampleFromPrior).

These implementations subsequently go out of date (sometimes silently), making it all very annoying to maintain.

The only "objection" to this change is that we should (hopefully soon) remove the need for upategids!, in which case this default overload is not that useful.

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

No branches or pull requests

2 participants