Merge pull request #23354 from zihaomu:issue_23351

DNN : fix bug in layer fusion
pull/23375/head
Alexander Smorkalov 2 years ago committed by GitHub
commit ccbc784195
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      modules/dnn/src/net_impl_fuse.cpp

@ -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);

Loading…
Cancel
Save