Skip to content

Conversation

@cpfiffer
Copy link
Member

I noticed islinked(vi, SampleFromPrior()) isn't allowed due to type constraints. Does this seem like a reasonable fix?


"""
islinked(vi::VarInfo, spl::Sampler)
islinked(vi::VarInfo, spl::Union{Sampler, SampleFromPrior})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a bit surprising that SampleFromPrior is not a subtype of Samper, but it is not a fault of this PR and can probably be fixed in the future.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe one could even just define this function for AbstractSampler.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm hesitant to do that because you might have subtypes of AbstractSampler that don't fit this paradigm, and you'd have some weird errors. I'd prefer to be explicit for when these functions are permitted for various functions in DynamicPPL (i.e. when spl is not a Sampler).

@yebai yebai mentioned this pull request May 22, 2020
@yebai yebai merged commit 9ec7fa0 into dev May 22, 2020
@bors bors bot deleted the cpfiffer-patch-1 branch May 22, 2020 16:16
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.

4 participants