# tff.backends.native.compile_to_mergeable_comp_form

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/federated/blob/v0.87.0 Version 2.0, January 2004 Licensed under the Apache License, Version 2.0 (the) |

Compiles a computation with a single aggregation to `MergeableCompForm`.

    tff.backends.native.compile_to_mergeable_comp_form(
        comp: https://www.tensorflow.org/federated/api_docs/python/tff/framework/ConcreteComputation
    ) -> https://www.tensorflow.org/federated/api_docs/python/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`.

<br />

<br />

<br />

| ## 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. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A semantically equivalent instance of `mergeable_comp_execution_context.MergeableCompForm`. ||

<br />

<br />

<br />

<br />

| ## 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. |

<br />