def LazyRun(self, job_func, *arg): assert self.status_ is SessionStatus.RUNNING remote_blobs = self.LaunchUserJob(job_func, *arg) if remote_blobs is None: return future_blob = LazyFutureRemoteBlobs(self).SetResult(remote_blobs).Inited() annotation = inspect.signature(job_func).return_annotation return oft_util.TransformGlobalFunctionResult(future_blob, annotation)
def EagerRun(self, function_desc, *arg): with self._EagerGlobalFunctionDescScope(function_desc): remote_blobs = compiler.EagerRun( self, function_desc, self.config_proto, arg ) if remote_blobs is None: return future_blob = EagerFutureRemoteBlobs().SetResult(remote_blobs).Inited() annotation = inspect.signature(function_desc.job_func).return_annotation return oft_util.TransformGlobalFunctionResult(future_blob, annotation)