-
Notifications
You must be signed in to change notification settings - Fork 126
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
How to generate random booleans with stablehlo.rng
?
#1313
Comments
I think the problem is not limited to For example, if the output element type is For example, if the output element type is I think we should either switch to close-close interval or allow |
Thanks @wecing and @loganchien for the findings and analysis. |
I would say this should be controlled with a flag. |
IMO, it's really that |
For int/bools, that makes sense given std::uniform_int_distribution follows that.
That is right: we can keep [closed, open) here given std::uniform_real_distribution. |
Thanks for all the inputs! |
That page also mentions:
I do wonder how useful would
|
I think the uniform distribution can only be achieved when both
I think these two limitations are known issues of C++ (or Boost Random Library) To some degree, I agree that serious users should not use But I think most use cases just expect some convenient access to floating point random values that look like uniform distributed in the close-open interval |
Based on my conversation with @wecing, there is no immediate rush to deliver on the feature and can wait for sometime in Q2. With that keeping this ticket unassigned for now to be addressed in Q2'23. |
What happened?
According to the spec:
Here if we want the result to be
i1
,a
andb
must also bei1
; becausea < b
, we havea == 0
andb == 1
. According to the spec, we will only generate values in the range of[0, 1)
, i.e. constant0
.Does
stablehlo.rng
ignorea
andb
when result type isi1
?Steps to reproduce your issue
No response
Version information
No response
The text was updated successfully, but these errors were encountered: