Missed TensorFlow World? Check out the recap. Learn more

tff.utils.build_encoded_broadcast

View source on GitHub

Builds StatefulBroadcastFn for values, to be encoded by encoders.

tff.utils.build_encoded_broadcast(
    values,
    encoders
)

Args:

  • values: Values to be broadcasted by the StatefulBroadcastFn. Must be convertible to tff.Value.
  • encoders: A collection of SimpleEncoder objects to be used for encoding values. Must have the same structure as values.

Returns:

A StatefulBroadcastFn of which next_fn encodes the input at tff.SERVER, broadcasts the encoded representation and decodes the encoded representation at tff.CLIENTS.

Raises:

  • ValueError: If values and encoders do not have the same structure.
  • TypeError: If encoders are not instances of SimpleEncoder, or if values are not compatible with the expected input of the encoders.