Change timeout from milliseconds to seconds in ray.wait. (#3706)

* Change timeout from milliseconds to seconds in ray.wait.

* Suppress warning.

* Suppress warning.

* Add prominent warning in API documentation.
This commit is contained in:
Robert Nishihara
2019-01-08 21:32:08 -08:00
committed by Philipp Moritz
parent 59d861281e
commit d1e21b702e
11 changed files with 58 additions and 37 deletions
+1 -1
View File
@@ -32,7 +32,7 @@ def collect_episodes(local_evaluator,
for a in remote_evaluators
]
collected, _ = ray.wait(
pending, num_returns=len(pending), timeout=timeout_seconds * 1000)
pending, num_returns=len(pending), timeout=timeout_seconds * 1.0)
num_metric_batches_dropped = len(pending) - len(collected)
metric_lists = ray.get(collected)
+2 -1
View File
@@ -28,7 +28,8 @@ class TaskPool(object):
def completed(self):
pending = list(self._tasks)
if pending:
ready, _ = ray.wait(pending, num_returns=len(pending), timeout=10)
ready, _ = ray.wait(
pending, num_returns=len(pending), timeout=0.01)
for obj_id in ready:
yield (self._tasks.pop(obj_id), self._objects.pop(obj_id))
+2 -1
View File
@@ -20,7 +20,8 @@ class Filter(object):
"""Creates a new object with same state as self.
Returns:
copy (Filter): Copy of self"""
A copy of self.
"""
raise NotImplementedError
def sync(self, other):