Distributions.jl
Distributions.jl copied to clipboard
`rand(Beta(1.0f0, 1.0f0))` returns `Float64`
Hi.
Samples from Beta(1.0f0, 1.0f0) are Float64 rather than the expected Float32. ~~This behavior seems to happen only for alpha=beta=1 and no other case~~. This behavior occurs when this condition is satisfied. For example
Beta(1.0f0, 1.0f0)::Float64
Beta(0.8f0, 0.8f0)::Float64
Beta(1.0f0, 2.0f0)::Float32
Beta(2.0f0, 1.0f0)::Float32
This one is a little more concerning than normal, because behavior is dependent on the value of the parameters (and not just the type of the parameters). I believe this is a regression caused by #1885
EDIT: I.e. the expected behavior a few months ago would be that both rand(Beta(1.0f0, 1.0f0) and rand(Beta(1.0f0, 2.0f0)) should return Float64. This may change with #1905
This issue is fixed by #1905.