From 17f2b5629167bb92687c9afaf54b748942ee7049 Mon Sep 17 00:00:00 2001 From: Zihao Mu Date: Wed, 2 Nov 2022 10:45:16 +0800 Subject: [PATCH] remove never used code in onnximporter --- modules/dnn/src/onnx/onnx_importer.cpp | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/modules/dnn/src/onnx/onnx_importer.cpp b/modules/dnn/src/onnx/onnx_importer.cpp index c420f3b..66f524a 100644 --- a/modules/dnn/src/onnx/onnx_importer.cpp +++ b/modules/dnn/src/onnx/onnx_importer.cpp @@ -2053,39 +2053,6 @@ void ONNXImporter::parseMatMul(LayerParams& layerParams, const opencv_onnx::Node addLayer(layerParams, node_proto); } -void findBroadAxis(const MatShape& broadShape, const MatShape& outShape, size_t& axis, int& broadAxis) -{ - // Currently, this function can only complete 1-dimensional expansion of broadShape. - // If there are two dimensions in broadShape that need to be expended, it will fail. - const size_t diff = outShape.size() - broadShape.size(); - - // find the first non-one element of the broadcasting shape - axis = 0; - for (; axis < broadShape.size() && broadShape[axis] == 1; ++axis) {} - - // find the last non-one element of the broadcasting shape - size_t endAxis = broadShape.size(); - for (; endAxis > axis && broadShape[endAxis - 1] == 1; --endAxis) {} - - // find one between axis and endAxis - as it needs to be broadcasted, - // dimensions from the left of axis and from the right of endAxis will be handled by Scale layer - broadAxis = -1; - for (size_t i = axis; i < endAxis; ++i) - { - size_t outAxis = i + diff; - if (outShape[outAxis] == broadShape[i]) - { - continue; - } - - // ensure we need to broadcast only 1 dimension in the middle - CV_Assert(broadShape[i] == 1 && broadAxis == -1); - broadAxis = static_cast(outAxis); - } - - axis += diff; -} - void ONNXImporter::parseConv(LayerParams& layerParams, const opencv_onnx::NodeProto& node_proto_) { opencv_onnx::NodeProto node_proto = node_proto_; -- 2.7.4