-
Notifications
You must be signed in to change notification settings - Fork 422
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
Is there a reason rand(TDist(nu))
does not obey the type of nu
?
#1884
Comments
Indeed, this seems to be a bug. |
Okay let me pick this up. |
Hi @devmotion I opened a PR, could you take a look when you have time? |
That's absolutely not the idea here. In the case of |
Hi @devmotion , unfortunately, it seems that calls to |
One option within the current interface, if you need more than one random value, is to call the I think there'll still be a double conversion going on (Float32 -> Float64-> Float32) if you call this on the current public version, but I think a side-effect of merging #1879 will cause things to stay |
Hi @devmotion , could you comment on how to proceed? |
Hmmmm that's annoying, that leads directly to all the At some point someone wanted Sure, we could just propagate this inconsistency a bit more but I'm a bit reluctant. Not because I think that it should return Maybe at least for univariate distributions we could start removing it from the Distributions.jl/src/genericrand.jl Lines 34 to 35 in e1340f0
return map(_ -> rand(rng, sampler(s)), CartesianIndices(dims)) (probably with an additional function barrier, similar to |
In a perfect world, I believe It is my view that a |
Hi, it seems that
returns a
Float64
instead of aFloat32
. Is this intended behavior? I find it unusual because therand
implementation tries to be type-stable half way there by usingone(T)
but ends up callingrandn(rng)
without specifying the type.The text was updated successfully, but these errors were encountered: