|View source on GitHub|
Aggregation factory for concatenation of input to a single tensor.
tff.templates.AggregationProcess takes the input structure,
reshapes each tensor in the structure to a rank-1 tensor, and concatenates
them into a single tensor, which is passed to the inner aggregation. After the
inner aggregation, the concatenated tensor is split and packed into the
For example, if this factory receives TFF type
inner_agg_factory will operate on
<float32[N + P * Q]>. Note that
the factory expects all tensors in the structure to have the same numeric
dtype; for example, an input
<string[N]> will raise an error.
This aggregator may be useful as a preprocessing step for algorithms that need to operate on client values as a single vector; for example, the algorithm may need to apply randomized Hadamard transform with zero padding on the client vectors, in which case applying the transform separately on each component may not be identical to applying the transform to the single vector at once.
The returned factory takes its weightedness
WeightedAggregationFactory) from the
||A factory specifying the type of aggregation to be done after flattening and concatenating the structure into a single vector.|
|An aggregation factory that flattens and concatenates the components of a tensor structure into a single rank-1 tensor.|