Prune operators and variables which are not needed to generate :code:`targets`. Notes: This is a very low level API. Users should not use this API directly. This API is in flux and not stable. Args: targets(list|Variable|Operator): A list of var
(self, targets)
| 6786 | self._name_generator = old_generator |
| 6787 | |
| 6788 | def _prune(self, targets): |
| 6789 | """ |
| 6790 | Prune operators and variables which are not needed to generate |
| 6791 | :code:`targets`. |
| 6792 | |
| 6793 | Notes: This is a very low level API. Users should not use this API |
| 6794 | directly. This API is in flux and not stable. |
| 6795 | |
| 6796 | Args: |
| 6797 | targets(list|Variable|Operator): A list of variables, operators, or variable names |
| 6798 | need to be pruned |
| 6799 | |
| 6800 | Returns: |
| 6801 | Program: A new, pruned program. |
| 6802 | """ |
| 6803 | return self._prune_with_input([], targets) |
| 6804 | |
| 6805 | def _prune_with_input(self, feeded_var_names, targets): |
| 6806 | """ |