-
Notifications
You must be signed in to change notification settings - Fork 32
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
Specifying rng
with DynamicPPL.evaluate!!
leads to StackOverflow
#370
Comments
(Removing the RNG leads it to run as expected) |
xref: #360 (comment) |
Speecifying both a sampling context and an RNG is redundant, hence IMO this should not be supported. But as mentioned in the comment linked above, we should clean the dispatches and function signatures such that it throws a MethodError instead of a StackOverflowError. |
Makes sense, but then the docstring should be fixed, as currently it says:
Which implies it should be possible to pass both an |
Hmm, this still throws an error:
|
Ahh, ok, looks like it requires either all the arguments to be passed or none of them. So this works:
But dropping |
No, there are a bunch of different constructors: Lines 135 to 138 in aeb5e03
function SamplingContext(
rng::AbstractRNG=Random.GLOBAL_RNG, sampler::AbstractSampler=SampleFromPrior()
)
return SamplingContext(rng, sampler, DefaultContext())
end
function SamplingContext(rng::AbstractRNG, context::AbstractContext)
return SamplingContext(rng, SampleFromPrior(), context)
end
function SamplingContext(sampler::AbstractSampler, context::AbstractContext=DefaultContext())
return SamplingContext(Random.GLOBAL_RNG, sampler, context)
end
function SamplingContext(context::AbstractContext)
return SamplingContext(Random.GLOBAL_RNG, SampleFromPrior(), context)
end |
That looks good to me. |
@mhauru is this fixed now recently? |
Yes, fixed by #629 |
I assume this is to do with some kind of accidental recursion/method ambiguity; the command:
leads to:
The text was updated successfully, but these errors were encountered: