A tff.program.FederatedDataSourceIterator that prefetches data.

Inherits From: FederatedDataSourceIterator

iterator A tff.program.FederatedDataSourceIterator used to prefetch data from.
total_iterations The total number of iterations.
iterations_to_prefetch The number of iterations to prefetch.
k_to_prefetch The number of elements to prefetch per round. Must be greater than 1 and must be identical across all iterations; attempts to select any other number of elements will fail.
prefetch_threshold The threshold below which the data source starts prefetching.

ValueError If k_to_prefetch is not greater than 1.
RuntimeError If the iterator is not constructed in an tff.framework.AsyncExecutionContext.

federated_type The type of the data returned by calling select.



View source

Deserializes the object from bytes.


View source

Returns a new selection of data from this iterator.

k A number of elements to select. Must be a positive integer and equal to k_to_prefetch.

ValueError If k is not a positive integer or if k is not equal to k_to_prefetch.


View source

Serializes the object to bytes.


View source

Return self==value.