We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e4ad06f commit 2f8d4b9Copy full SHA for 2f8d4b9
pytorch_lightning/loops/utilities.py
@@ -166,5 +166,5 @@ def _get_active_optimizers(
166
current_place_in_loop = batch_idx % optimizers_loop_length
167
168
# find optimizer index by looking for the first {item > current_place} in the cumsum list
169
- opt_idx = int(np.argmax(freq_cumsum > current_place_in_loop))
+ opt_idx = np.searchsorted(freq_cumsum, current_place_in_loop, side="right")
170
return [(opt_idx, optimizers[opt_idx])]
0 commit comments