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 seed when testing Parameter Shift Rule. #1185

Merged
merged 2 commits into from
Feb 2, 2024
Merged

Fix seed when testing Parameter Shift Rule. #1185

merged 2 commits into from
Feb 2, 2024

Conversation

MatteoRobbiati
Copy link
Contributor

@MatteoRobbiati MatteoRobbiati commented Feb 2, 2024

Fixing #1181.
Thanks @renatomello for raising the issue. Fixing the random generator seed should prevent such failed tests.

Checklist:

  • Reviewers confirm new code works as expected.
  • Tests are passing.
  • Coverage does not decrease.
  • Documentation is updated.

Copy link

codecov bot commented Feb 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (df5b00b) 100.00% compared to head (c4fddea) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #1185   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           68        68           
  Lines         9883      9883           
=========================================
  Hits          9883      9883           
Flag Coverage Δ
unittests 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

renatomello
renatomello previously approved these changes Feb 2, 2024
@renatomello renatomello dismissed their stale review February 2, 2024 04:49

Something else came up

@renatomello
Copy link
Contributor

Does fixing the seed using numpy also solves the issue for GPU backends?

tests/test_derivative.py Outdated Show resolved Hide resolved
tests/test_derivative.py Outdated Show resolved Hide resolved
@MatteoRobbiati
Copy link
Contributor Author

Does fixing the seed using numpy also solves the issue for GPU backends?

Oh yes, you are right! Thanks!

@renatomello renatomello added this pull request to the merge queue Feb 2, 2024
Merged via the queue into master with commit 51a0e92 Feb 2, 2024
21 checks passed
@renatomello renatomello deleted the test_psr branch February 2, 2024 08:34
@renatomello renatomello changed the title Fix numpy.random seed when testing Parameter Shift Rule. Fix seed when testing Parameter Shift Rule. Feb 2, 2024
@renatomello renatomello linked an issue Feb 2, 2024 that may be closed by this pull request
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.

Paramether Shift Rule (PSR) test failing on CI
3 participants