Skip to content

Commit a4ababe

Browse files
authored
Added type annotation and comment. (#60)
1 parent 1e79731 commit a4ababe

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

compiler_opt/distributed/worker.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"""Common abstraction for a worker contract."""
1616

1717
import abc
18-
from typing import Generic, Iterable, TypeVar
18+
from typing import Generic, Iterable, Optional, TypeVar
1919

2020

2121
class Worker:
@@ -50,7 +50,7 @@ def wait_for(futures: Iterable[WorkerFuture]):
5050
pass
5151

5252

53-
def get_exception(worker_future: WorkerFuture):
53+
def get_exception(worker_future: WorkerFuture) -> Optional[Exception]:
5454
assert worker_future.done()
5555
try:
5656
_ = worker_future.result()

compiler_opt/rl/local_data_collector.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def __init__(
5454
# work completes, i.e. cancelling all work and re-enabling the workers.
5555
# We remove this activity from the critical path by running it concurrently
5656
# with the training phase - i.e. whatever happens between successive data
57-
# collection calls.
57+
# collection calls. Subsequent runs will wait for these to finish.
5858
self._reset_workers: concurrent.futures.Future = None
5959
self._current_work: List[Tuple[corpus.ModuleSpec, worker.WorkerFuture]] = []
6060
self._pool = concurrent.futures.ThreadPoolExecutor()

0 commit comments

Comments
 (0)