Thanks for tuning in to Google I/O. View all sessions on demandWatch on demand

tff.program.ClientIdDataSourceIterator

A tff.program.FederatedDataSourceIterator backed by client ids.

Inherits From: FederatedDataSourceIterator

A tff.program.FederatedDataSourceIterator backed by sequence of client ids, one client id per client. It selects client ids uniformly at random, with replacement over successive calls of select() but without replacement within a single call of select().

client_ids A sequence of client ids to use to yield the ids from this data source.

ValueError If client_ids is empty.

federated_type The type of the data returned by calling select.

Methods

from_bytes

View source

Deserializes the object from bytes.

select

View source

Returns a new selection of client ids from this iterator.

Args
num_clients A number of clients to use when selecting data. Must be a positive integer and less than the total number of client_ids.

Raises
ValueError If num_clients is not a positive integer or if num_clients is not less than the total number of client_ids.

to_bytes

View source

Serializes the object to bytes.

__eq__

View source

Return self==value.