mirror of
https://github.com/wassname/ray.git
synced 2026-08-12 12:20:11 +08:00
export remote functions and reusable variables that were defined before connect was called (#292)
This commit is contained in:
committed by
Philipp Moritz
parent
8e9f98c5ff
commit
3bae6f136b
@@ -2,10 +2,6 @@ import sys
|
||||
import argparse
|
||||
import numpy as np
|
||||
|
||||
import ray.array.remote as ra
|
||||
import ray.array.distributed as da
|
||||
import example_functions
|
||||
|
||||
import ray
|
||||
|
||||
parser = argparse.ArgumentParser(description="Parse addresses for the worker to connect to.")
|
||||
@@ -17,12 +13,4 @@ if __name__ == "__main__":
|
||||
args = parser.parse_args()
|
||||
ray.worker.connect(args.scheduler_address, args.objstore_address, args.worker_address)
|
||||
|
||||
ray.register_module(ra)
|
||||
ray.register_module(ra.random)
|
||||
ray.register_module(ra.linalg)
|
||||
ray.register_module(da)
|
||||
ray.register_module(da.random)
|
||||
ray.register_module(da.linalg)
|
||||
ray.register_module(example_functions)
|
||||
|
||||
ray.worker.main_loop()
|
||||
|
||||
@@ -16,7 +16,7 @@ def increment(x):
|
||||
def add(a, b):
|
||||
return a + b
|
||||
|
||||
@ray.remote([List[int]], [np.ndarray])
|
||||
@ray.remote([List], [np.ndarray])
|
||||
def zeros(shape):
|
||||
return np.zeros(shape)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user