Builds a stateful aggregator for tensorflow_privacy DPQueries.
StatefulAggregateFn can be called with any nested structure for
the values being statefully aggregated. However, it's necessary to provide two
functions as arguments which indicate the properties (the
tff.Type and the
structure.Struct conversion) of the nested structure that will
be used. If using a
collections.OrderedDict as the value's nested structure,
the defaults for the arguments suffice.
A DPQuery to aggregate. For compatibility with tensorflow_federated,
the global_state and sample_state of the query must be structures
supported by tf.nest.
Python function that takes the value argument of next_fn and
returns the value type. This will be used in determining the TensorSpecs
that establish the initial sample state. If the value being aggregated is
collections.OrderedDict, the default for this argument can be used.
This argument probably gets removed once b/123092620 is addressed (and the
associated processing step gets replaced with a simple call to
A tuple of:
computation_utils.StatefulAggregateFn that aggregates according to
- the TFF type of the DP aggregator's global state