federated/utils/data_utils.py
def _convert_fn(dataset: tf.data.Dataset) -> tf.data.Dataset:
    """Converts dataset to tupled dataset.

    Args:
        dataset (tf.data.Dataset): Dataset.

    Returns:
        tf.data.Dataset: Returns tupled dataset.
    """
    spec = dataset.element_spec
    if isinstance(spec, collections.abc.Mapping):
        return dataset.map(lambda observation: (observation["x"], observation["y"]))
    else:
        return dataset.map(lambda x, y: (x, y))
Converts dataset to tupled dataset.

    Args:
        dataset (tf.data.Dataset): Dataset.

    Returns:
        tf.data.Dataset: Returns tupled dataset.
    
Converts dataset to tupled dataset.
Converts dataset to tupled dataset .
def _convert_fn(dataset: tf.data.Dataset) -> tf.data.Dataset:
    spec = dataset.element_spec
    if isinstance(spec, collections.abc.Mapping):
        return dataset.map(lambda observation: (observation["x"], observation["y"]))
    else:
        return dataset.map(lambda x, y: (x, y))
def _convert_fn ( dataset : tf . data . Dataset ) -> tf . data . Dataset : spec = dataset . element_spec if isinstance ( spec , collections . abc . Mapping ) : return dataset . map ( lambda observation : ( observation [ "x" ] , observation [ "y" ] ) ) else : return dataset . map ( lambda x , y : ( x , y ) )
Converts dataset to tupled dataset.
Converts dataset to tupled dataset .
"""Converts dataset to tupled dataset.

    Args:
        dataset (tf.data.Dataset): Dataset.

    Returns:
        tf.data.Dataset: Returns tupled dataset.
    """
Returns tupled dataset.
Returns tupled dataset .
tf.data.Dataset
dataset
tf.data.Dataset
None