# tff.tensorflow.replace_intrinsics_with_bodies

<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) |

Iterates over all intrinsic bodies, inlining the intrinsics in `comp`.

    tff.tensorflow.replace_intrinsics_with_bodies(
        comp
    )

This function operates on the AST level; meaning, it takes in a
`building_blocks.ComputationBuildingBlock` as an argument and
returns one as well. `replace_intrinsics_with_bodies` is intended to be the
standard reduction function, which will reduce all currently implemented
intrinsics to their bodies.

Notice that the success of this function depends on the contract of
`intrinsic_bodies.get_intrinsic_bodies`, that the dict returned by that
function is ordered from more complex intrinsic to less complex intrinsics.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `comp` | Instance of `building_blocks.ComputationBuildingBlock` in which we wish to replace all intrinsics with their bodies. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| Instance of `building_blocks.ComputationBuildingBlock` with all the intrinsics from `intrinsic_bodies.py` inlined with their bodies, along with a Boolean indicating whether there was any inlining in fact done. ||

<br />

<br />

<br />

<br />

| ## Raises ||
|---|---|
| `TypeError` | If the types don't match. |

<br />