|View source on GitHub|
An abstract interface for representing federated data source iterators.
This interface abstracts away the specifics of iterating over data in a data source.
Things one can do with a data source iterator:
Determine the type of the data supplied by this iterator by inspecting the
federated_typeproperty. The type returned must match that of the data source that returned this iterator.
Return a new selection of federated data from the iterator by invoking
tff.program.FederatedDataSource for additional context and the
high-level description of how to use data sources.
The type of the data returned by calling
from_bytes( buffer: bytes ) -> 'Serializable'
Deserializes the object from bytes.
select( num_clients: Optional[int] = None ) -> object
Returns a new selection of federated data from this iterator.
The selection contains data distributed across a cohort of logical clients.
The manner in which this cohort is constructed is a function of the
arguments supplied here by the caller (such as
num_clients) as well as by
the capabilities of the data source itself (e.g., whether it offers data
selected uniformly at random, performs sampling without replacement,
guarantees determinism, etc.).
Optional, the number of clients to select. Must be a positive
An object of type
to_bytes() -> bytes
Serializes the object to bytes.