![]() |
Factory class encapsulating executor compositional logic.
Inherits From: ExecutorFactory
tff.framework.ComposingExecutorFactory(
*,
max_fanout: int,
unplaced_ex_factory: tff.framework.UnplacedExecutorFactory
,
flat_stack_fn: Callable[[executor_factory.CardinalitiesType], Sequence[executor_base.Executor]
],
local_computation_factory: local_computation_factory_base.LocalComputationFactory = tensorflow_computation_factory.TensorFlowComputationFactory()
)
This class is responsible for aggregating lists of executors into a
compositional hierarchy based on the max_fanout
parameter.
Methods
clean_up_executor
clean_up_executor(
cardinalities: tff.framework.CardinalitiesType
)
Holds no executors internally, so passes on cleanup.
create_executor
create_executor(
cardinalities: tff.framework.CardinalitiesType
) -> tff.framework.Executor
Creates an executor hierarchy of maximum width self._max_fanout
.
First creates a flat list of executors to aggregate, using the
flat_stack_fn
passed in at initialization. Then composes this list
into a hierarchy of width at most self._max_fanout
.
Args | |
---|---|
cardinalities
|
A mapping from placements to integers specifying the cardinalities at each placement |
Returns | |
---|---|
An executor_base.Executor satisfying the conditions above.
|