A list of string identifiers for clients in this dataset.
dataset_fn
A callable that accepts a str as an argument and returns a
tf.data.Dataset instance. Unlike from_client_and_tf_dataset_fn, it
does not require a TF serializable dataset function.
database_filepath
A str filepath to the SQL database.
allow_overwrite
A boolean indicating whether to allow overwriting if file
already exists at dataset_filepath.
split_names_by_client_id
An optional mapping from client identifier to a
str identifier for the split (e.g. "train") the client belongs to.
Raises
FileExistsError
if file exists at dataset_filepath and allow_overwrite
is False. If overwriting is intended, please use allow_overwrite = True.
ElementSpecCompatibilityError
if the element_spec of local datasets are not
identical across clients, or if the element_spec of datasets are not of
type Mapping[str, TensorSpec].
ValueError
If split_names_by_client_id is passed and is missing an entry
for a client in client_ids.
[null,null,["Last updated 2024-09-20 UTC."],[],[],null,["# tff.simulation.datasets.save_to_sql_client_data\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\nSerialize a federated dataset into a SQL database compatible with `SqlClientData`. \n\n tff.simulation.datasets.save_to_sql_client_data(\n client_ids: list[str],\n dataset_fn: Callable[[str], tf.data.Dataset],\n database_filepath: str,\n allow_overwrite: bool = False,\n split_names_by_client_id: Optional[Mapping[str, str]] = None\n ) -\u003e None\n\n| **Note:** All the clients must share the same dataset.element_spec of type `Mapping[str, TensorSpec]`.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|----------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `client_ids` | A list of string identifiers for clients in this dataset. |\n| `dataset_fn` | A callable that accepts a `str` as an argument and returns a [`tf.data.Dataset`](https://www.tensorflow.org/api_docs/python/tf/data/Dataset) instance. Unlike `from_client_and_tf_dataset_fn`, it does not require a TF serializable dataset function. |\n| `database_filepath` | A `str` filepath to the SQL database. |\n| `allow_overwrite` | A boolean indicating whether to allow overwriting if file already exists at dataset_filepath. |\n| `split_names_by_client_id` | An optional mapping from client identifier to a `str` identifier for the split (e.g. `\"train\"`) the client belongs to. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Raises ------ ||\n|---------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `FileExistsError` | if file exists at `dataset_filepath` and `allow_overwrite` is False. If overwriting is intended, please use allow_overwrite = True. |\n| `ElementSpecCompatibilityError` | if the element_spec of local datasets are not identical across clients, or if the element_spec of datasets are not of type `Mapping[str, TensorSpec]`. |\n| `ValueError` | If `split_names_by_client_id` is passed and is missing an entry for a client in `client_ids`. |\n\n\u003cbr /\u003e"]]