From 4356abeb1c0c524c00e557dcb7b63587f3c34471 Mon Sep 17 00:00:00 2001 From: Zhe Zhang Date: Mon, 31 Aug 2020 13:57:10 -0700 Subject: [PATCH] [Doc] Fix errors in ActorPool documentation (#10410) * Fix errors in ActorPool documentation 1. map() and map_unordered() name 2. The print statement doesn't work * Correctly change lines * Address comments from pr --- python/ray/util/actor_pool.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/python/ray/util/actor_pool.py b/python/ray/util/actor_pool.py index cd87236e1..4aad576db 100644 --- a/python/ray/util/actor_pool.py +++ b/python/ray/util/actor_pool.py @@ -10,7 +10,8 @@ class ActorPool: Examples: >>> a1, a2 = Actor.remote(), Actor.remote() >>> pool = ActorPool([a1, a2]) - >>> print(pool.map(lambda a, v: a.double.remote(v), [1, 2, 3, 4])) + >>> print(list(pool.map(lambda a, v: a.double.remote(v),\ + ... [1, 2, 3, 4]))) [2, 4, 6, 8] """ @@ -52,7 +53,8 @@ class ActorPool: Examples: >>> pool = ActorPool(...) - >>> print(pool.map(lambda a, v: a.double.remote(v), [1, 2, 3, 4])) + >>> print(list(pool.map(lambda a, v: a.double.remote(v),\ + ... [1, 2, 3, 4]))) [2, 4, 6, 8] """ for v in values: @@ -79,7 +81,8 @@ class ActorPool: Examples: >>> pool = ActorPool(...) - >>> print(pool.map(lambda a, v: a.double.remote(v), [1, 2, 3, 4])) + >>> print(list(pool.map_unordered(lambda a, v: a.double.remote(v),\ + ... [1, 2, 3, 4]))) [6, 2, 4, 8] """ for v in values: