mirror of
https://github.com/wassname/ray.git
synced 2026-06-27 19:00:36 +08:00
remove example functions and remove imports from shell (#314)
This commit is contained in:
committed by
Philipp Moritz
parent
352e5e1dd2
commit
bcd0e3781f
@@ -1,33 +0,0 @@
|
||||
import ray
|
||||
import numpy as np
|
||||
from typing import List
|
||||
|
||||
@ray.remote([int], [float])
|
||||
def estimate_pi(n):
|
||||
x = np.random.uniform(size=n)
|
||||
y = np.random.uniform(size=n)
|
||||
return 4 * np.mean(x ** 2 + y ** 2 < 1)
|
||||
|
||||
@ray.remote([int], [int])
|
||||
def increment(x):
|
||||
return x + 1
|
||||
|
||||
@ray.remote([int, int], [int])
|
||||
def add(a, b):
|
||||
return a + b
|
||||
|
||||
@ray.remote([List], [np.ndarray])
|
||||
def zeros(shape):
|
||||
return np.zeros(shape)
|
||||
|
||||
@ray.remote([np.ndarray, np.ndarray], [np.ndarray])
|
||||
def dot(a, b):
|
||||
return np.dot(a, b)
|
||||
|
||||
@ray.remote([], [])
|
||||
def throw_exception():
|
||||
raise Exception("This function intentionally failed.")
|
||||
|
||||
@ray.remote([], [])
|
||||
def no_op():
|
||||
pass
|
||||
@@ -6,10 +6,6 @@ import numpy as np
|
||||
|
||||
import ray
|
||||
|
||||
import ray.array.remote as ra
|
||||
import ray.array.distributed as da
|
||||
import example_functions
|
||||
|
||||
def main(argv):
|
||||
DEFAULT_NUM_WORKERS = 1
|
||||
DEFAULT_WORKER_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)), "default_worker.py")
|
||||
|
||||
Reference in New Issue
Block a user