saealib.ThreadPoolEvaluator#

saealib.ThreadPoolEvaluator#

:py:class:`~saealib.execution.evaluator.AsyncEvaluator`の別名です。

Methods

__init__

acknowledge

Acknowledge one asynchronous update.

can_reattach

Return whether pending work can be restored after checkpoint load.

cancel

Cancel work that has not started.

close

Release worker resources.

collect

Collect one completed update, optionally without waiting.

contract

Return the evaluator family contract.

detach

Detach a running future and discard its eventual result.

evaluate_batch

Evaluate one batch on the wrapped evaluator.

evaluate_request

Evaluate a request, including its public metadata boundary.

has_partial_lifecycle_override

Return whether lifecycle adapter methods are only partly overridden.

reattach

Restore a pending request or raise when unsupported.

submit

Submit work without blocking the caller.

supports_batch_rollback

Return whether submitted futures can be detached.

Method Details

ThreadPoolEvaluator.__init__(evaluator=None, *, max_workers=1)#
パラメータ:
  • evaluator (Evaluator | None)

  • max_workers (int)

戻り値の型:

None

ThreadPoolEvaluator.acknowledge(handle, sequence)#

Acknowledge one asynchronous update.

パラメータ:
戻り値の型:

None

ThreadPoolEvaluator.can_reattach(pending)#

Return whether pending work can be restored after checkpoint load.

パラメータ:

pending (PendingEvaluation)

戻り値の型:

bool

ThreadPoolEvaluator.cancel(handle)#

Cancel work that has not started.

パラメータ:

handle (EvaluationHandle)

戻り値の型:

bool

ThreadPoolEvaluator.close()#

Release worker resources.

戻り値の型:

None

ThreadPoolEvaluator.collect(handle, *, wait=True)#

Collect one completed update, optionally without waiting.

パラメータ:
戻り値の型:

list[EvaluationUpdate]

ThreadPoolEvaluator.contract()#

Return the evaluator family contract.

戻り値の型:

ComponentContract

ThreadPoolEvaluator.detach(handle)#

Detach a running future and discard its eventual result.

パラメータ:

handle (EvaluationHandle)

戻り値の型:

bool

ThreadPoolEvaluator.evaluate_batch(x, problem)#

Evaluate one batch on the wrapped evaluator.

パラメータ:
  • x (GenomeBatch | np.ndarray)

  • problem (Problem)

戻り値の型:

EvaluationResult

ThreadPoolEvaluator.evaluate_request(request, problem)#

Evaluate a request, including its public metadata boundary.

パラメータ:
戻り値の型:

EvaluationResult

classmethod ThreadPoolEvaluator.has_partial_lifecycle_override()#

Return whether lifecycle adapter methods are only partly overridden.

戻り値の型:

bool

ThreadPoolEvaluator.reattach(pending, problem)#

Restore a pending request or raise when unsupported.

パラメータ:
戻り値の型:

EvaluationHandle

ThreadPoolEvaluator.submit(request, problem)#

Submit work without blocking the caller.

パラメータ:
戻り値の型:

EvaluationHandle

ThreadPoolEvaluator.supports_batch_rollback()#

Return whether submitted futures can be detached.

戻り値の型:

bool