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

Can't sample multidimensional arrays #482

Closed
amrods opened this issue Apr 5, 2019 · 1 comment
Closed

Can't sample multidimensional arrays #482

amrods opened this issue Apr 5, 2019 · 1 comment

Comments

@amrods
Copy link
Contributor

amrods commented Apr 5, 2019

I am opening a new issue here. I first mentioned it in issue 161 but didn't get attention. I think this is a very easy fix.

sample has trouble dispatching method 8 of the methods table:

sample(a::AbstractArray, dims::Tuple{Vararg{Int64,N}} where N; replace, ordered)

so sample(1:100, (2,2)) gives a methods error:

julia> sample(1:100, (2,2))
ERROR: MethodError: no method matching sample!(::MersenneTwister, ::UnitRange{Int64}, ::Array{Int64,2}, ::MersenneTwister; replace=true, ordered=false)

I think this is because the rng argument is repeated in line 393 of sampling.jl

@nalimilan
Copy link
Member

Thanks. Can you suggest a fix or make a pull request?

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