tff.utils.build_encoded_broadcast

Builds StatefulBroadcastFn for values, to be encoded by encoders.

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.

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

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.