mirror of
https://github.com/wassname/ray.git
synced 2026-07-09 21:02:01 +08:00
[api] Initial API deprecations for Ray 1.0 (#10325)
This commit is contained in:
@@ -2,13 +2,11 @@ from ray.util import iter
|
||||
from ray.util.actor_pool import ActorPool
|
||||
from ray.util.debug import log_once, disable_log_once_globally, \
|
||||
enable_periodic_logging
|
||||
from ray.util.named_actors import get_actor
|
||||
|
||||
__all__ = [
|
||||
"ActorPool",
|
||||
"disable_log_once_globally",
|
||||
"enable_periodic_logging",
|
||||
"get_actor",
|
||||
"iter",
|
||||
"log_once",
|
||||
]
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
import logging
|
||||
|
||||
import ray
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def _get_actor(name):
|
||||
worker = ray.worker.global_worker
|
||||
handle = worker.core_worker.get_named_actor_handle(name)
|
||||
return handle
|
||||
|
||||
|
||||
def get_actor(name: str) -> ray.actor.ActorHandle:
|
||||
"""Get a named actor which was previously created.
|
||||
|
||||
If the actor doesn't exist, an exception will be raised.
|
||||
|
||||
Args:
|
||||
name: The name of the named actor.
|
||||
|
||||
Returns:
|
||||
The ActorHandle object corresponding to the name.
|
||||
"""
|
||||
logger.warning("ray.util.get_actor has been moved to ray.get_actor and "
|
||||
"will be removed in the future.")
|
||||
return _get_actor(name)
|
||||
@@ -102,7 +102,7 @@ if __name__ == "__main__":
|
||||
|
||||
args, _ = parser.parse_known_args()
|
||||
num_cpus = 4 if args.smoke_test else None
|
||||
ray.init(address=args.address, num_cpus=num_cpus, log_to_driver=True)
|
||||
ray.init(address=args.address, num_cpus=num_cpus, _log_to_driver=True)
|
||||
|
||||
trainer1 = TorchTrainer(
|
||||
model_creator=ResNet18,
|
||||
|
||||
@@ -98,7 +98,7 @@ if __name__ == "__main__":
|
||||
"--tune", action="store_true", default=False, help="Tune training")
|
||||
|
||||
args, _ = parser.parse_known_args()
|
||||
ray.init(address=args.address, log_to_driver=True)
|
||||
ray.init(address=args.address, _log_to_driver=True)
|
||||
|
||||
TorchTrainable = TorchTrainer.as_trainable(
|
||||
model_creator=ResNet18,
|
||||
|
||||
Reference in New Issue
Block a user