(self)
| 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 | """ |
no test coverage detected