Publishing 2019 R1 content
[platform/upstream/dldt.git] / model-optimizer / extensions / middle / ConvertLayoutDependentOperations.py
index 7f2e87c..9308506 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.layout import indices_mapping
-from mo.graph.graph import Node
+from mo.graph.graph import Node, Graph
 from mo.middle.replacement import MiddleReplacementPattern
 from mo.ops.op import Op, PermuteAttrs
 from mo.ops.permute import Permute
@@ -32,9 +30,10 @@ class ConvertLayoutDependentOperations(MiddleReplacementPattern):
     enabled = True
 
     def run_after(self):
-        return []
+        from extensions.middle.pass_separator import MiddleStart
+        return [MiddleStart]
 
-    def find_and_replace_pattern(self, graph: nx.MultiDiGraph):
+    def find_and_replace_pattern(self, graph: Graph):
         for node in list(graph.nodes()):
             node = Node(graph, node)
             # Check that node layout mismatch with graph layout