-
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.
Use np.array_split instead of np.split to support uneven splits in sp…
…sa._batch_evaluate (#8634) * Use np.array_split instead of np.split to support uneven splits in spsa._batch_evaluate * better testing Co-authored-by: Julien Gacon <gaconju@gmail.com> * Update test/python/algorithms/optimizers/test_spsa.py Co-authored-by: Julien Gacon <gaconju@gmail.com> * len of a boolean * Apply suggestions from code review * Fix Sphinx ref Co-authored-by: Julien Gacon <gaconju@gmail.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
- Loading branch information
1 parent
219032d
commit 69ad6c6
Showing
3 changed files
with
21 additions
and
1 deletion.
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
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,6 @@ | ||
--- | ||
fixes: | ||
- | | ||
When the class :class:`~.SPSA` was using `np.split` (from NumPy) for splitting the jobs in even batches, | ||
resulting in an exception if a perfectly even split was not possible. Now, it uses `np.array_split`, which is safer | ||
for these cases. |
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