tff.tensorflow.replace_intrinsics_with_bodies
Stay organized with collections
Save and categorize content based on your preferences.
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.
Args |
comp
|
Instance of building_blocks.ComputationBuildingBlock in which we
wish to replace all intrinsics with their bodies.
|
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.
|
Raises |
TypeError
|
If the types don't match.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-20 UTC.
[null,null,["Last updated 2024-09-20 UTC."],[],[],null,["# tff.tensorflow.replace_intrinsics_with_bodies\n\n\u003cbr /\u003e\n\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [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) |\n\nIterates over all intrinsic bodies, inlining the intrinsics in `comp`. \n\n tff.tensorflow.replace_intrinsics_with_bodies(\n comp\n )\n\nThis function operates on the AST level; meaning, it takes in a\n`building_blocks.ComputationBuildingBlock` as an argument and\nreturns one as well. `replace_intrinsics_with_bodies` is intended to be the\nstandard reduction function, which will reduce all currently implemented\nintrinsics to their bodies.\n\nNotice that the success of this function depends on the contract of\n`intrinsic_bodies.get_intrinsic_bodies`, that the dict returned by that\nfunction is ordered from more complex intrinsic to less complex intrinsics.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|--------|----------------------------------------------------------------------------------------------------------------------|\n| `comp` | Instance of `building_blocks.ComputationBuildingBlock` in which we wish to replace all intrinsics with their bodies. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| 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. ||\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Raises ------ ||\n|-------------|---------------------------|\n| `TypeError` | If the types don't match. |\n\n\u003cbr /\u003e"]]