[ MO ] Groupped conv fusion (#797)
authorEvgenya Stepyreva <evgenya.stepyreva@intel.com>
Mon, 8 Jun 2020 10:00:54 +0000 (13:00 +0300)
committerGitHub <noreply@github.com>
Mon, 8 Jun 2020 10:00:54 +0000 (13:00 +0300)
Fixed the group convolution fusion pass to properly get the feature dim in NCHW layout case.

model-optimizer/mo/middle/passes/fusing/fuse_grouped_conv.py

index 80e3ce5..97d7abf 100644 (file)
@@ -100,7 +100,7 @@ def concat_convolutions(graph: Graph, start_node: Node, last_node: Node):
     weights_value = np.array(weights_node.value)
     bias_value = np.array(bias_node.value) if has_biases else None
 
-    feature_dim = 3 if graph.graph['layout'] == 'NHWC' else 1
+    feature_dim = 3 if graph.graph['layout'] == 'NHWC' else 0
 
     for conv in conv_nodes[1:]:
         weights_value = np.concatenate((weights_value, conv.in_node(1).value), axis=feature_dim)