コード例 #1
0
ファイル: worker.py プロジェクト: stefanbschneider/ray
 def _convert_function(self, func: "RemoteFunction") -> str:
     """Register a ClientRemoteFunc for the ActorClass and return a UUID"""
     key = uuid.uuid4().hex
     f = func._function
     self._converted[key] = ClientRemoteFunc(f,
                                             options={
                                                 "num_cpus":
                                                 func._num_cpus,
                                                 "num_gpus":
                                                 func._num_gpus,
                                                 "max_calls":
                                                 func._max_calls,
                                                 "max_retries":
                                                 func._max_retries,
                                                 "resources":
                                                 func._resources,
                                                 "accelerator_type":
                                                 func._accelerator_type,
                                                 "num_returns":
                                                 func._num_returns,
                                                 "memory":
                                                 func._memory,
                                                 "runtime_env":
                                                 func._runtime_env,
                                             })
     return key
コード例 #2
0
 def _convert_function(self, func: "RemoteFunction") -> str:
     """Register a ClientRemoteFunc for the ActorClass and return a UUID"""
     key = uuid.uuid4().hex
     self._converted[key] = ClientRemoteFunc(
         func._function, options=func._default_options
     )
     return key