Publishing 2019 R1 content
[platform/upstream/dldt.git] / model-optimizer / extensions / back / ConvolutionReshaper.py
index 155d1eb..9cbbb10 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
 import numpy as np
 
+from extensions.back.ReshapeMutation import ReshapeMutation
 from mo.back.replacement import BackReplacementPattern
+from mo.graph.graph import Graph
 from mo.ops.reshape import Reshape
 
 
@@ -30,6 +31,9 @@ class ConvolutionReshaper(BackReplacementPattern):
     """
     enabled = True
 
+    def run_before(self):
+        return [ReshapeMutation]
+
     @staticmethod
     def pattern():
         return dict(
@@ -39,7 +43,7 @@ class ConvolutionReshaper(BackReplacementPattern):
             edges=[]
         )
 
-    def replace_pattern(self, graph: nx.MultiDiGraph, match: dict):
+    def replace_pattern(self, graph: Graph, match: dict):
         conv = match['conv']
 
         assert len(conv.out_nodes()) == 1, "Convolution operation {} should have 1 output data node".format(conv.id)