Missed TensorFlow Dev Summit? Check out the video playlist. Watch recordings


View source on GitHub

Builds StatefulBroadcastFn for weights of model returned by model_fn.

    model_fn, encoder_fn

This method creates a SimpleEncoder for every weight of model created by model_fn, as returned by encoder_fn.


  • model_fn: A Python callable with no arguments function that returns a tff.learning.Model.
  • encoder_fn: A Python callable with a single argument, which is expected to be a tf.Tensor of shape and dtype to be encoded. The function must return a tensor_encoding.core.SimpleEncoder, which expects a tf.Tensor with compatible type as the input to its encode method.


A StatefulBroadcastFn for encoding and broadcasting the weights of model created by model_fn.


  • TypeError: If model_fn or encoder_fn are not callable objects.