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

Fix value for random seed if input seed parameter #101

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

Conversation

pragmaticTNT
Copy link
Contributor

Many modules have a private _seed parameter. Currently, when initializing with a seed parameter, _seed is set to the logical or of this value and a pseudorandom string. Instead, I believe that the intended behaviour is to set _seed to seed and only generate the pseudorandom string if seed is null.

Copy link

google-cla bot commented Oct 21, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@vezhnick vezhnick self-requested a review October 22, 2024 13:35
@vezhnick vezhnick self-assigned this Oct 22, 2024
vezhnick
vezhnick previously approved these changes Oct 22, 2024
Copy link
Collaborator

@vezhnick vezhnick left a comment

Choose a reason for hiding this comment

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

This fixes the case when seed=0, which would have made self._seed = seed or random.getrandbits(63) assign random sample to the seed

copybara-service bot pushed a commit that referenced this pull request Oct 22, 2024
--
d010a62 by Pragma <[email protected]>:

Modified setting of random seed for modules

COPYBARA_INTEGRATE_REVIEW=#101 from pragmaticTNT:main 8507f1a
PiperOrigin-RevId: 688535463
Change-Id: Id25cf807f48955dcccb394712a4dda7d1853af8e
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.

2 participants