MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle / _prune

Method _prune

python/paddle/base/framework.py:6788–6803  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Callers 5

_initializeMethod · 0.80
check_pruneMethod · 0.80

Calls 1

_prune_with_inputMethod · 0.95

Tested by 3

check_pruneMethod · 0.64