You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have noticed that even when declaring Gamma, Exponential and similar distributions to be of type Float32, sampling always returns a Float64. Not sure if this is intentional or not, but it seems to be easily fixed by always calling randexp(rng, T) with T being the type of the parameters of the distribution.
Would be interested to know if this was intentional? It does not seem like it to me given that rand will return Float32 for gaussians of type Float32.
The text was updated successfully, but these errors were encountered:
Yes, this is intentional (BTW usually type instability refers to functions for which the type can't be inferred which is not the case here). There are some open issues (#1071) and a PR that would fix current inconsistencies (#1433). Unfortunately, there are some issues with dual numbers and I didn't have much time lately, but I hope I (or someone else) can pick it up and fix the remaining issues in the near future.
Distributions.jl/src/univariate/continuous/exponential.jl
Line 104 in eff3f1c
I have noticed that even when declaring Gamma, Exponential and similar distributions to be of type Float32, sampling always returns a Float64. Not sure if this is intentional or not, but it seems to be easily fixed by always calling
randexp(rng, T)
with T being the type of the parameters of the distribution.Would be interested to know if this was intentional? It does not seem like it to me given that
rand
will return Float32 for gaussians of type Float32.The text was updated successfully, but these errors were encountered: