tff.federated_reduce( value, zero, op )
This method reduces a set of member constituents of a
value of federated type
T@CLIENTS for some
T, using a given
zero in the algebra (i.e., the result
of reducing an empty set) of some type
U, and a reduction operator
(<U,T> -> U) that incorporates a single
value into the
U-typed result of partial reduction. In the
special case of
T equal to
U, this corresponds to the classical notion of
reduction of a set using a commutative associative binary operator. The
generalized reduction (with
T not equal to
U) requires that repeated
op to reduce a set of
T always yields the same
result, regardless of the order in which elements of
T are processed in the
course of the reduction.
value: A value of a TFF federated type placed at the
zero: The result of reducing a value with no constituents.
op: An operator with type signature
(<U,T> -> U), where
Tis the type of the constituents of
Uis the type of
zeroto be used in performing the reduction.
A representation on the
of the result of reducing the set of all member constituents of
op into a single item.
TypeError: if the arguments are not of the types specified above.