MCPcopy Index your code
hub / github.com/ray-project/ray / test_recursion

Function test_recursion

python/ray/tests/test_worker_capping.py:52–61  ·  view source on GitHub ↗
(shutdown_only)

Source from the content-addressed store, hash-verified

50
51
52def test_recursion(shutdown_only):
53 ray.init(num_cpus=1)
54
55 @ray.remote
56 def summer(n):
57 if n == 0:
58 return 0
59 return n + ray.get(summer.remote(n - 1))
60
61 assert ray.get(summer.remote(10)) == sum(range(11))
62
63
64def test_out_of_order_scheduling(shutdown_only):

Callers

nothing calls this directly

Calls 5

sumFunction · 0.70
getMethod · 0.65
rangeFunction · 0.50
initMethod · 0.45
remoteMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…