tff.framework.ReconstructOnChangeExecutorFactory

ExecutorFactory exposing hook to construct executors on environment change.

Inherits From: ExecutorFactory

When the initialization parameter change_query returns True, ReconstructOnChangeExecutorFactory` constructs a new executor, bypassing any previously constructed executors.

Methods

clean_up_executor

View source

Releases any resources associated to the given cardinalities.

Note that calling this method may invalidate the state of any executors which have previously been returned by the factory with the cardinalities argument ; create_executor should be called again if a new executor which is safe to use is desired.

Args
cardinalities The cardinalities of the executor whose state we wish to clear.

create_executor

View source

Returns a new or existing executor, depending on change_query.

create_executor constructs a new executor whenever change_query returns True when called with argument cardinalities. If change_query returns False, create_executor is free to inspect its internal executor cache and return a previously constructed executor if one is available.

Args
cardinalities A mapping from placement literals to ints.

Returns
An executor_base.Executor obeying the semantics above.