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

Custom univariate sampler not working as expected #1132

Closed
nluetts opened this issue Jun 11, 2020 · 3 comments
Closed

Custom univariate sampler not working as expected #1132

nluetts opened this issue Jun 11, 2020 · 3 comments

Comments

@nluetts
Copy link

nluetts commented Jun 11, 2020

Implementing a univariate sampler as described in the documentation, i.e. just implementing the function

function rand(s::Spl)
    # ... generate a single sample from s
end

is not working as expected. Specifically, the documentation says:

The package already implements a vectorized version of rand! and rand that repeatedly calls the he scalar version to generate multiple samples.

So after implementing the function above, I was expecting generating several samples at once (calling rand(mysampler, 10000)) to work, but it throws an error. However, it works fine if the function rand(rng::AbstractRNG, s::Spl) is implemented.

For a full code example, see this discussion on julia discourse.

Is the documentation regarding custom samplers perhaps outdated?

@devmotion
Copy link
Member

Would be fixed by #1114.

@IoachimusRoderici
Copy link

IoachimusRoderici commented Dec 12, 2024

I think the docs have been fixed as of v0.25 (docs).

Should this issue be closed?

@devmotion
Copy link
Member

Indeed, this issue seems to be fixed 🙂

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

3 participants