![]() |
A tff.program.FederatedDataSourceIterator
backed by tf.data.Dataset
s.
Inherits From: FederatedDataSourceIterator
tff.program.DatasetDataSourceIterator(
datasets: Sequence[tf.data.Dataset],
federated_type: tff.types.FederatedType
)
A tff.program.FederatedDataSourceIterator
backed by a sequence of
tf.data.Dataset's, one
tf.data.Dataset' per client. It selects datasources
uniformly at random, with replacement over successive calls of select()
but
without replacement within a single call of select()
.
Raises | |
---|---|
ValueError
|
If datasets is empty or if each tf.data.Dataset in
datasets does not have the same type specification.
|
Attributes | |
---|---|
federated_type
|
The type of the data returned by calling select .
|
Methods
from_bytes
@classmethod
from_bytes( buffer: bytes ) -> 'DatasetDataSourceIterator'
Deserializes the object from bytes.
select
select(
num_clients: Optional[int] = None
) -> object
Returns a new selection of data from this iterator.
Args | |
---|---|
num_clients
|
A number of clients to use when selecting data. Must be a
positive integer and less than the number of datasets .
|
Raises | |
---|---|
ValueError
|
If num_clients is not a positive integer or if num_clients
is not less than the number of datasets .
|
to_bytes
to_bytes() -> bytes
Serializes the object to bytes.
__eq__
__eq__(
other: object
) -> bool
Return self==value.