tff.program.FederatedDataSourceIterator
Stay organized with collections
Save and categorize content based on your preferences.
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_type
property. 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
select
.
Please see tff.program.FederatedDataSource
for additional context and the
high-level description of how to use data sources.
Attributes |
federated_type
|
The type of the data returned by calling select .
|
Methods
from_bytes
View source
@classmethod
@abc.abstractmethod
from_bytes(
buffer: bytes
) -> 'Serializable'
Deserializes the object from bytes.
select
View source
@abc.abstractmethod
select(
k: Optional[int] = None
) -> object
Returns a new selection of federated data from this iterator.
Args |
k
|
An optional number of elements to select. Must be a positive integer,
or None if unspecified.
|
to_bytes
View source
@abc.abstractmethod
to_bytes() -> bytes
Serializes the object to bytes.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-20 UTC.
[null,null,["Last updated 2024-09-20 UTC."],[],[],null,["# tff.program.FederatedDataSourceIterator\n\n\u003cbr /\u003e\n\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/federated/blob/v0.87.0 Version 2.0, January 2004 Licensed under the Apache License, Version 2.0 (the) |\n\nAn abstract interface for representing federated data source iterators.\n\nThis interface abstracts away the specifics of iterating over data in a data\nsource.\n\nThings one can do with a data source iterator:\n\n- Determine the type of the data supplied by this iterator by inspecting\n the `federated_type` property. The type returned must match that of the data\n source that returned this iterator.\n\n- Return a new selection of federated data from the iterator by invoking\n `select`.\n\nPlease see [`tff.program.FederatedDataSource`](../../tff/program/FederatedDataSource) for additional context and the\nhigh-level description of how to use data sources.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Attributes ---------- ||\n|------------------|----------------------------------------------------|\n| `federated_type` | The type of the data returned by calling `select`. |\n\n\u003cbr /\u003e\n\nMethods\n-------\n\n### `from_bytes`\n\n[View source](https://github.com/tensorflow/federated/blob/v0.87.0\nVersion 2.0, January 2004\nLicensed under the Apache License, Version 2.0 (the) \n\n @classmethod\n @abc.abstractmethod\n from_bytes(\n buffer: bytes\n ) -\u003e 'Serializable'\n\nDeserializes the object from bytes.\n\n### `select`\n\n[View source](https://github.com/tensorflow/federated/blob/v0.87.0\nVersion 2.0, January 2004\nLicensed under the Apache License, Version 2.0 (the) \n\n @abc.abstractmethod\n select(\n k: Optional[int] = None\n ) -\u003e object\n\nReturns a new selection of federated data from this iterator.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ||\n|-----|-------------------------------------------------------------------------------------------------|\n| `k` | An optional number of elements to select. Must be a positive integer, or `None` if unspecified. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|---|---|\n| An object of type `federated_type` representing the selected data, and that can be supplied as an argument to a [`tff.Computation`](../../tff/Computation). See [`tff.program.FederatedContext`](../../tff/program/FederatedContext) for more information about these types. ||\n\n\u003cbr /\u003e\n\n### `to_bytes`\n\n[View source](https://github.com/tensorflow/federated/blob/v0.87.0\nVersion 2.0, January 2004\nLicensed under the Apache License, Version 2.0 (the) \n\n @abc.abstractmethod\n to_bytes() -\u003e bytes\n\nSerializes the object to bytes."]]