"""
- Copyright (c) 2018 Intel Corporation
+ Copyright (c) 2018-2019 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
import networkx as nx
from mo.front.common.replacement import FrontReplacementSubgraph
-from mo.graph.graph import erase_node
+from mo.graph.graph import Graph
class StandaloneConstEraser(FrontReplacementSubgraph):
)
@staticmethod
- def replace_sub_graph(graph: nx.MultiDiGraph, match: dict):
+ def replace_sub_graph(graph: Graph, match: dict):
if not len(match['const'].in_edges()) and len(match['const'].out_edges()) == 1:
- erase_node(match['const'])
- erase_node(match['output'])
+ graph.erase_node(match['const'])
+ graph.erase_node(match['output'])
log.info("Standalone Const node \"{}\" was removed from the graph".format(match['const'].id))