-
Notifications
You must be signed in to change notification settings - Fork 415
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
Inconsistent Type Behavior for Uniform Distribution #1783
Comments
The main reason for the current behaviour is rooted in the historical development process. Initially, only Float64 was supported and was hardcoded in many places. Over time these restrictions were lifted in some places but thereby consistency was lost. There is no clear mental model, unfortunately, but I think currently you should always expect samples of contonuous distributions to be of type There is a strong incentive though to fix these issues soonish. Therefore I think it's not worth documenting the current buggy behaviour. |
I see, thank you very much. |
Just ran into this same issue. For the case of If I should expect |
Probably should be This issue recently came up on discourse. |
Hey.
Not only do Distributions still behave differently with regards to types when generating one or multiple samples ( #1252 ), but the behavior is also inconsistent between different types:
This follows from type promotion rules. An attempted solution would be something along the lines of:
But the type of single numbers would still differ from that of arrays:
On the other hand,
rand!
seems to ignore the type parameter completely:Is there a mental model for this behavior? If so, wouldn't it be a good idea to include it in the docs? They currently contain no references whatsoever to type precision.
The text was updated successfully, but these errors were encountered: