Publishing 2019 R1 content
[platform/upstream/dldt.git] / model-optimizer / extensions / middle / ConstSwitchResolver.py
index 73459b0..ad9171c 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.
@@ -14,9 +14,7 @@
  limitations under the License.
 """
 
-import networkx as nx
-
-from mo.graph.graph import Node
+from mo.graph.graph import Node, Graph
 from mo.middle.passes.eliminate import remove_op_node_with_data_node
 from mo.middle.replacement import MiddleReplacementPattern
 from mo.utils.graph import pseudo_topological_sort
@@ -28,7 +26,11 @@ class ConstSwitchEraser(MiddleReplacementPattern):
     """
     enabled = True
 
-    def find_and_replace_pattern(self, graph: nx.MultiDiGraph):
+    def run_after(self):
+        from extensions.middle.pass_separator import MiddleStart
+        return [MiddleStart]
+
+    def find_and_replace_pattern(self, graph: Graph):
         for n in pseudo_topological_sort(graph):
             if graph.node[n]['kind'] == 'data' or graph.node[n]['op'] != 'Switch':
                 continue