×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Python
Posted by: dan darm
Added: Feb 28, 2021 8:08 PM
Views: 4776
Tags: ray
  1. import ray
  2. ray.init()
  3.  
  4. @ray.remote
  5. def f(x):
  6.     return x * x
  7.  
  8. futures = [f.remote(i) for i in range(400000)]
  9. print(ray.get(futures))