1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 15:23:05 +04:00

Merge pull request #23625 from zihaomu:improve_conv

DNN: Remove unnecessary flags for convolution
This commit is contained in:
Alexander Smorkalov
2023-05-26 12:59:36 +03:00
committed by GitHub
3 changed files with 2 additions and 6 deletions
@@ -116,9 +116,6 @@ public:
fusedWeights = false;
fusedBias = false;
if (kernel_size.size() == 2)
isConv2D = true;
}
virtual void finalize(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr) CV_OVERRIDE
+2 -2
View File
@@ -194,8 +194,8 @@ void Net::Impl::fuseLayers(const std::vector<LayerPin>& blobsToKeep_)
// To avoid the order like: conv + activ + add, if we found the conv has been fused with activ, we break.
Ptr<ConvolutionLayer> convLayer = ld.layerInstance.dynamicCast<ConvolutionLayer>();
// Only Conv2D without fusion Activation supports this fusion, other-wise, we skip.
if (!convLayer->isConv2D || convLayer->fusedActivation)
// Only Convolution layer without fusion Activation supports this fusion, other-wise, we skip.
if (convLayer->fusedActivation)
break;
// For now, there are currently two layers in OpenCV that run the Add operator.