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

Merge pull request #23354 from zihaomu:issue_23351

DNN : fix bug in layer fusion
This commit is contained in:
Alexander Smorkalov
2023-03-14 17:23:25 +03:00
committed by GitHub
+1 -1
View File
@@ -247,7 +247,7 @@ void Net::Impl::fuseLayers(const std::vector<LayerPin>& blobsToKeep_)
{
// fuse naryEltwise layer
// bias must already be computed to fuse => bias layer must appear before convolution
if (biasLayerData->id < ld.id)
if (biasLayerData->id < ld.id && biasLayerData->consumers.size() == 1)
{
// conv + naryEltwise.
CV_Assert_N(biasLayerData->outputBlobs.size() == 1, ld.inputBlobs.size() == 1);