Compiles a computation with a single aggregation to MergeableCompForm
.
tff.backends.native.compile_to_mergeable_comp_form(
comp: tff.framework.ConcreteComputation
) -> tff.framework.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
.
Args |
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.
|
Returns |
A semantically equivalent instance of
mergeable_comp_execution_context.MergeableCompForm .
|
Raises |
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.
|