Skip to content
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

[CUDA] Fix random generator routines for f32 and f64 to make sure the returned value is in [0, 1) #4243

Merged
merged 13 commits into from
Feb 9, 2022

Conversation

neozhaoliang
Copy link
Contributor

@neozhaoliang neozhaoliang commented Feb 9, 2022

Currently the return value by ti.random(f32) (or ti.random(f64) ) has a chance to be equal to 1.0, due to float precision problem. This PR fixes this problem.

@netlify
Copy link

netlify bot commented Feb 9, 2022

✔️ Deploy Preview for docsite-preview ready!

🔨 Explore the source changes: 596f243

🔍 Inspect the deploy log: https://app.netlify.com/sites/docsite-preview/deploys/62035e4c0affcf0008382812

😎 Browse the preview: https://deploy-preview-4243--docsite-preview.netlify.app

@neozhaoliang neozhaoliang changed the title [CUDA] fix random generator routines for f32 and f64 to make sure the returned value is in [0, 1) [CUDA] Fix random generator routines for f32 and f64 to make sure the returned value is in [0, 1) Feb 9, 2022
qiao-bo
qiao-bo approved these changes Feb 9, 2022
@qiao-bo qiao-bo self-requested a review February 9, 2022 05:38
Copy link
Contributor

@qiao-bo qiao-bo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just to undo the approve~

Copy link
Contributor

@qiao-bo qiao-bo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, just one typo. Thanks!

@neozhaoliang
Copy link
Contributor Author

The typo is fixed.

@qiao-bo qiao-bo merged commit bae96c4 into taichi-dev:master Feb 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants