tff.backends.native.compile_to_mergeable_comp_form

Compiles a computation with a single aggregation to MergeableCompForm.

Compilation proceeds by splitting on the lone aggregation, and using the aggregation's internal functions to generate a semantically equivalent instance of mergeable_comp_execution_context.MergeableCompForm.

comp Instance of computation_impl.ConcreteComputation to compile. Assumed to be representable as a computation with a single aggregation in its body, so that for example two parallel aggregations are allowed, but multiple dependent aggregations are disallowed. Additionally assumed to be of functional type.

A semantically equivalent instance of mergeable_comp_execution_context.MergeableCompForm.

TypeError If comp is not a building block, or is not of functional TFF type.
ValueError If comp cannot be represented as a computation with at most one aggregation in its body.