mirror of
https://github.com/wassname/ray.git
synced 2026-07-02 05:33:18 +08:00
[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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user