Publishing 2019 R1 content
[platform/upstream/dldt.git] / model-optimizer / extensions / front / standalone_const_eraser.py
index 98ea814..295f9a3 100644 (file)
@@ -1,5 +1,5 @@
 """
- 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.
@@ -19,7 +19,7 @@ import logging as log
 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):
@@ -35,8 +35,8 @@ 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))