mirror of
https://github.com/wassname/ray.git
synced 2026-06-28 18:45:03 +08:00
18 lines
591 B
Python
18 lines
591 B
Python
from joblib.parallel import register_parallel_backend
|
|
|
|
|
|
def register_ray():
|
|
""" Register Ray Backend to be called with parallel_backend("ray"). """
|
|
try:
|
|
from ray.experimental.joblib.ray_backend import RayBackend
|
|
register_parallel_backend("ray", RayBackend)
|
|
except ImportError:
|
|
msg = ("To use the ray backend you must install ray."
|
|
"Try running 'pip install ray'."
|
|
"See https://ray.readthedocs.io/en/latest/installation.html"
|
|
"for more information.")
|
|
raise ImportError(msg)
|
|
|
|
|
|
__all__ = ["register_ray"]
|