Skip to content

Commit

Permalink
fix: safer pipeline.clear()
Browse files Browse the repository at this point in the history
  • Loading branch information
sash-a committed Oct 11, 2024
1 parent 8be8037 commit 4748636
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mava/utils/sebulba.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,10 @@ def get(
def clear(self) -> None:
"""Clear the pipeline."""
while not self._queue.empty():
self._queue.get()
try:
self._queue.get(block=False)
except queue.Empty:
break

def shard_split_playload(self, payload: Any, axis: int = 0) -> Any:
split_payload = jnp.split(payload, len(self.learner_devices), axis=axis)
Expand Down

0 comments on commit 4748636

Please sign in to comment.