mirror of
https://github.com/wassname/ray.git
synced 2026-06-28 09:29:05 +08:00
Rename _submit -> _remote. (#3321)
This commit is contained in:
committed by
Philipp Moritz
parent
98edf752a9
commit
d10cb570ab
@@ -5,6 +5,7 @@ from __future__ import print_function
|
||||
import copy
|
||||
import hashlib
|
||||
import inspect
|
||||
import logging
|
||||
|
||||
import ray.ray_constants as ray_constants
|
||||
import ray.signature
|
||||
@@ -14,6 +15,8 @@ DEFAULT_REMOTE_FUNCTION_CPUS = 1
|
||||
DEFAULT_REMOTE_FUNCTION_NUM_RETURN_VALS = 1
|
||||
DEFAULT_REMOTE_FUNCTION_MAX_CALLS = 0
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def compute_function_id(function):
|
||||
"""Compute an function ID for a function.
|
||||
@@ -97,7 +100,7 @@ class RemoteFunction(object):
|
||||
|
||||
def remote(self, *args, **kwargs):
|
||||
"""This runs immediately when a remote function is called."""
|
||||
return self._submit(args=args, kwargs=kwargs)
|
||||
return self._remote(args=args, kwargs=kwargs)
|
||||
|
||||
def _submit(self,
|
||||
args=None,
|
||||
@@ -106,6 +109,23 @@ class RemoteFunction(object):
|
||||
num_cpus=None,
|
||||
num_gpus=None,
|
||||
resources=None):
|
||||
logger.warn(
|
||||
"WARNING: _submit() is being deprecated. Please use _remote().")
|
||||
return self._remote(
|
||||
args=args,
|
||||
kwargs=kwargs,
|
||||
num_return_vals=num_return_vals,
|
||||
num_cpus=num_cpus,
|
||||
num_gpus=num_gpus,
|
||||
resources=resources)
|
||||
|
||||
def _remote(self,
|
||||
args=None,
|
||||
kwargs=None,
|
||||
num_return_vals=None,
|
||||
num_cpus=None,
|
||||
num_gpus=None,
|
||||
resources=None):
|
||||
"""An experimental alternate way to submit remote functions."""
|
||||
worker = ray.worker.get_global_worker()
|
||||
worker.check_connected()
|
||||
|
||||
Reference in New Issue
Block a user