mirror of
https://github.com/vale981/ray
synced 2025-03-06 10:31:39 -05:00
Give error when actor is created before ray.init. (#1666)
This commit is contained in:
parent
a9acfab3a6
commit
b0510ee461
1 changed files with 4 additions and 0 deletions
|
@ -706,6 +706,10 @@ def actor_handle_from_class(Class, class_id, resources, checkpoint_interval):
|
|||
|
||||
@classmethod
|
||||
def remote(cls, *args, **kwargs):
|
||||
if ray.worker.global_worker.mode is None:
|
||||
raise Exception("Actors cannot be created before ray.init() "
|
||||
"has been called.")
|
||||
|
||||
actor_id = random_actor_id()
|
||||
# The ID for this instance of ActorHandle. These should be unique
|
||||
# across instances with the same _ray_actor_id.
|
||||
|
|
Loading…
Add table
Reference in a new issue