|View source on GitHub|
Returns the least-loaded ps task for op placement.
tf.contrib.training.GreedyLoadBalancingStrategy( num_tasks, load_fn )
The load is calculated by a user-specified load function passed in at construction. There are no units for load, and the load function is responsible for providing an internally consistent measure.
Note that this strategy is very sensitive to the exact order in which ps ops (typically variables) are created, as it greedily places ops on the least-loaded ps at the point each op is processed.
One reasonable heuristic is the
estimates load as the number of bytes that would be used to store and
transmit the entire variable. More advanced load functions
could consider the difference in access patterns across ops, or trade
off CPU-intensive ops with RAM-intensive ops with network bandwidth.
This class is intended to be used as a
||Number of ps tasks to cycle among.|
A callable that takes an
__call__( op )
Choose a ps task index for the given
The next ps task index to use for the