-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix random seed initialization between runs in SabreSwap (#9127)
* Fix random seed initialization between runs in SabreSwap This commit fixes an issue in the case no random seed is provided by the user when initializing an instance of SabreSwap. The pass was previously potentially reusing the random seed between runs even if no seed was specified. This was an artifact of storing the initial seed as an instance variable. Instead this commit just relies on the the Rust RNG to initialize from entropy if no seed is specified. * Remove unused numpy import (cherry picked from commit dfbc738)
- Loading branch information
1 parent
93791df
commit 97d7f07
Showing
3 changed files
with
14 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
releasenotes/notes/fix-sabre-swap-random-seed-dcf3dace63042791.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
fixes: | ||
- | | ||
Fixed an issue with the :class:`~.SabreSwap` pass which would cause the | ||
output of multiple runs of the pass without the ``seed`` argument specified | ||
to reuse the same random number generator seed between runs instead of | ||
using different seeds. This previously caused identical results to be | ||
returned between runs even when no ``seed`` was specified. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters