×

Welcome to TagMyCode

Please login or create account to add a snippet.
1
0
 
1
Language: Python
Posted by: dan darm
Added: Feb 28, 2021 8:08 PM
Views: 4786
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))