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

Method resolve_hazard

python/paddle/base/framework.py:5853–5872  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

5851 core.graph_safe_remove_nodes(self.graph, original_nodes)
5852
5853 def resolve_hazard(self):
5854 ordered_nodes = core.topology_sort(self.graph)
5855 var_nodes = {}
5856 for node in ordered_nodes:
5857 if node.is_op() and node.op() is not None:
5858 for each_var_name in node.op().input_arg_names():
5859 if each_var_name not in var_nodes:
5860 var_nodes[each_var_name] = [
5861 self._find_node_by_name(node.inputs, each_var_name)
5862 ]
5863 for each_var_name in node.op().output_arg_names():
5864 if each_var_name not in var_nodes:
5865 var_nodes[each_var_name] = [
5866 self._find_node_by_name(node.outputs, each_var_name)
5867 ]
5868 else:
5869 var_nodes[each_var_name].append(
5870 self._find_node_by_name(node.outputs, each_var_name)
5871 )
5872 self.graph.resolve_hazard(var_nodes)
5873
5874 def has_circle(self):
5875 """

Callers 8

applyMethod · 0.45
applyMethod · 0.45
applyMethod · 0.45
applyMethod · 0.45
applyMethod · 0.45
applyMethod · 0.45
applyMethod · 0.45
save_quantized_modelMethod · 0.45

Calls 7

_find_node_by_nameMethod · 0.95
topology_sortMethod · 0.80
is_opMethod · 0.80
opMethod · 0.45
input_arg_namesMethod · 0.45
output_arg_namesMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected