From ecd2e8ff470c987f7afd822936472b5115e99dce Mon Sep 17 00:00:00 2001 From: Abduragim Shtanchaev Date: Mon, 29 May 2023 14:48:42 +0300 Subject: [PATCH] added index that check all inputs of nodes that match --- modules/dnn/src/onnx/onnx_graph_simplifier.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/dnn/src/onnx/onnx_graph_simplifier.cpp b/modules/dnn/src/onnx/onnx_graph_simplifier.cpp index 84b9125dcf..120cd936b7 100644 --- a/modules/dnn/src/onnx/onnx_graph_simplifier.cpp +++ b/modules/dnn/src/onnx/onnx_graph_simplifier.cpp @@ -808,7 +808,7 @@ public: const Ptr node_to_check = net->getNode(i); int numInp = node_to_check->getNumInputs(); for (int inp = 0; inp < numInp; ++inp) { - if (i != nodeToMatch && inpNodeName == node_to_check->getInputName(0)) { + if (i != nodeToMatch && inpNodeName == node_to_check->getInputName(inp)) { // Another node has the same input node, so it cannot be merged. return false; }