[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
This commit is contained in:
Zhe Zhang
2020-08-31 13:57:10 -07:00
committed by GitHub
parent 25f5614691
commit 4356abeb1c
+6 -3
View File
@@ -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: