Created
April 16, 2020 23:11
-
-
Save looselycoupled/b257eba6b656209f98d4302ecbeffd3d to your computer and use it in GitHub Desktop.
Simple Ray demo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ray | |
from collections import Counter | |
import socket | |
from pprint import pprint | |
ray.init("auto") | |
@ray.remote | |
def f(x): | |
return x + (socket.gethostname(), ) | |
cc = Counter(ray.get([f.remote(f.remote(())) for _ in range(100)])) | |
pprint(cc) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment