Esempio n. 1
0
File: worker.py Progetto: alipay/ray
 def _convert_actor(self, actor: "ActorClass") -> str:
     """Register a ClientActorClass for the ActorClass and return a UUID"""
     key = uuid.uuid4().hex
     cls = actor.__ray_metadata__.modified_class
     self._converted[key] = ClientActorClass(cls,
                                             options=actor._default_options)
     return key
Esempio n. 2
0
 def _convert_actor(self, actor: "ActorClass") -> str:
     """Register a ClientActorClass for the ActorClass and return a UUID"""
     key = uuid.uuid4().hex
     md = actor.__ray_metadata__
     cls = md.modified_class
     self._converted[key] = ClientActorClass(cls,
                                             options={
                                                 "max_restarts":
                                                 md.max_restarts,
                                                 "max_task_retries":
                                                 md.max_task_retries,
                                                 "num_cpus":
                                                 md.num_cpus,
                                                 "num_gpus":
                                                 md.num_gpus,
                                                 "memory":
                                                 md.memory,
                                                 "object_store_memory":
                                                 md.object_store_memory,
                                                 "resources":
                                                 md.resources,
                                                 "accelerator_type":
                                                 md.accelerator_type,
                                             })
     return key