MCPcopy
hub / github.com/ray-project/ray / _make_remote

Function _make_remote

python/ray/_private/worker.py:3373–3397  ·  view source on GitHub ↗
(function_or_class, options)

Source from the content-addressed store, hash-verified

3371
3372
3373def _make_remote(function_or_class, options):
3374 if not function_or_class.__module__:
3375 function_or_class.__module__ = "global"
3376
3377 if inspect.isfunction(function_or_class) or is_cython(function_or_class):
3378 is_generator_callable = inspect.isgeneratorfunction(
3379 function_or_class
3380 ) or inspect.isasyncgenfunction(function_or_class)
3381 ray_option_utils.validate_task_options(
3382 options, in_options=False, is_generator_callable=is_generator_callable
3383 )
3384 return ray.remote_function.RemoteFunction(
3385 Language.PYTHON,
3386 function_or_class,
3387 None,
3388 options,
3389 )
3390
3391 if inspect.isclass(function_or_class):
3392 ray_option_utils.validate_actor_options(options, in_options=False)
3393 return ray.actor._make_actor(function_or_class, options)
3394
3395 raise TypeError(
3396 "The @ray.remote decorator must be applied to either a function or a class."
3397 )
3398
3399
3400class RemoteDecorator(Protocol):

Callers 1

remoteFunction · 0.85

Calls 1

is_cythonFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…