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

[stdlib] rename variance parameter to std (standard deviation) #4118

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

illiasheshyn
Copy link

addresses the following issue regarding the argument name in randn_float64() as well as randn.

The choice to go with standard deviation over variance was made based on the existing random.gauss function from Python's standard library and numpy's random.normal which both take mean and standard deviation.

Things to consider

  • the new argument name could arguably be more descriptive.
  • the added test does increase the testing time by 2-3 seconds on my machine.

Changes

  • renames the argument for randn_float64() and randn
  • extends the corresponding unit tests

@soraros
Copy link
Contributor

soraros commented Mar 6, 2025

Can we move this test to a separate function (for this is a borderline quality test) and use seed to reduce the number of iterations (and thus the run time)?

@illiasheshyn illiasheshyn force-pushed the update-random-normal-arg-variance-name branch from b76ccc1 to c3c6e5c Compare March 7, 2025 03:05
@illiasheshyn
Copy link
Author

@soraros thanks for the quick review! Do the changes align with what you had in mind?

Copy link
Collaborator

@JoeLoser JoeLoser left a comment

Choose a reason for hiding this comment

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

Looks good once the minor naming quibble is addressed. Do you mind also adding a changelog entry here as well for this bug fix?

I'll fix the internal parameter name to match in KGEN_CompilerRT_NormalDouble when I sync this.

Thanks again for fixing this bug!

@JoeLoser JoeLoser self-assigned this Mar 10, 2025
…y distributed random values

Signed-off-by: Illia Sheshyn <187636533+illiasheshyn@users.noreply.github.com>
Signed-off-by: Illia Sheshyn <187636533+illiasheshyn@users.noreply.github.com>
Signed-off-by: Illia Sheshyn <187636533+illiasheshyn@users.noreply.github.com>
Signed-off-by: Illia Sheshyn <187636533+illiasheshyn@users.noreply.github.com>
@illiasheshyn illiasheshyn force-pushed the update-random-normal-arg-variance-name branch from c3c6e5c to 34c48f6 Compare March 10, 2025 22:25
@illiasheshyn
Copy link
Author

Do let me know if the changelog entry needs any tweaks at all 👍

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