Trying to work through the example of using sub-graph replacement in the model optimiser, it seems that it's not possible to replace a sub graph in the caffe flow.
I've added a line to mo/pipeline/caffe.py ....
FrontReplacementSubgraph.find_and_replace_all_patterns(graph) # ADDED THIS LINE FrontReplacementOp.find_and_replace_all_patterns(graph) graph = create_tensor_nodes(graph) log.debug("After create_tensor_nodes") print_graph_stat(graph)
With that in place the subgraph replacement is happening as expected.
I'm developing some fpga kernels under DLA which I'm plugging into OpenVino. As a simple case for this I attach a trivial example with caffe model, custom node (extensions/ops/neg_concat_relu.py) and subgraph replacement thing extensions\front\ncr_graph.py.
In this case, the resutls on a convolution are negated through a power layer and concatenated before the relu is applied. We can optimise this in fpga with a few simple changes to the normal relu kernel which would mean we don't need to the power, or concat.
I can't share more details of our customer use case in a public forum but can be contacted on email@example.com if needed.