Publishing 2019 R1 content
[platform/upstream/dldt.git] / model-optimizer / extensions / front / tf / Unpack.py
index 30af2d3..0054598 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.
  limitations under the License.
 """
 
-import networkx as nx
-
 from mo.front.common.replacement import FrontReplacementOp
-from mo.graph.graph import Node, insert_node_after
+from mo.graph.graph import Node, Graph
 from mo.ops.squeeze import Squeeze
 
 
@@ -29,14 +27,14 @@ class Unpack(FrontReplacementOp):
     op = "Unpack"
     enabled = True
 
-    def nodes_to_remove(self, graph: nx.MultiDiGraph, match: dict):
+    def nodes_to_remove(self, graph: Graph, match: dict):
         # do not remove matched node
         return []
 
-    def replace_op(self, graph: nx.MultiDiGraph, node: Node):
+    def replace_op(self, graph: Graph, node: Node):
         for ind in range(len(node.out_nodes())):
             squeeze_node = Squeeze(graph, dict(squeeze_dims=[node.axis], name=node.name + '/Squeeze_')).create_node([])
-            insert_node_after(node, squeeze_node, ind)
+            node.insert_node_after(squeeze_node, ind)
 
         # do not replace any output edge
         return []