Skip to content

Instantly share code, notes, and snippets.

@robertnishihara
Created February 11, 2019 04:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robertnishihara/44bd5720e34a106c4c6e643f3450cea2 to your computer and use it in GitHub Desktop.
Save robertnishihara/44bd5720e34a106c4c6e643f3450cea2 to your computer and use it in GitHub Desktop.
import numpy as np
@ray.remote
def create_matrix(size):
return np.random.normal(size=size)
@ray.remote
def multiply_matrices(x, y):
return np.dot(x, y)
x_id = create_matrix.remote([1000, 1000])
y_id = create_matrix.remote([1000, 1000])
z_id = multiply_matrices.remote(x_id, y_id)
# Get the results.
z = ray.get(z_id)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment