提交 36915db6 编写于 作者: A Alexander Alekhin

Merge pull request #18260 from alalek:static_code_fixes_2

...@@ -405,7 +405,9 @@ struct SPRT_history { ...@@ -405,7 +405,9 @@ struct SPRT_history {
double epsilon, delta, A; double epsilon, delta, A;
// number of samples processed by test // number of samples processed by test
int tested_samples; // k int tested_samples; // k
SPRT_history () { SPRT_history ()
: epsilon(0), delta(0), A(0)
{
tested_samples = 0; tested_samples = 0;
} }
}; };
......
...@@ -2731,6 +2731,7 @@ struct Net::Impl : public detail::NetImplBase ...@@ -2731,6 +2731,7 @@ struct Net::Impl : public detail::NetImplBase
bool fuse_eltwise = false, fuse_activation = false; bool fuse_eltwise = false, fuse_activation = false;
if (IS_DNN_OPENCL_TARGET(preferableTarget) && !nextFusabeleActivLayer.empty() && if (IS_DNN_OPENCL_TARGET(preferableTarget) && !nextFusabeleActivLayer.empty() &&
nextData &&
(!nextData->type.compare("ReLU") || (!nextData->type.compare("ReLU") ||
!nextData->type.compare("ChannelsPReLU") || !nextData->type.compare("ChannelsPReLU") ||
!nextData->type.compare("Power")) && !nextData->type.compare("Power")) &&
...@@ -2753,7 +2754,7 @@ struct Net::Impl : public detail::NetImplBase ...@@ -2753,7 +2754,7 @@ struct Net::Impl : public detail::NetImplBase
if (currLayer->tryFuse(layer)) if (currLayer->tryFuse(layer))
{ {
fuse_eltwise = true; /* eltwise was successfully fused */ fuse_eltwise = true; /* eltwise was successfully fused */
if (!nextFusabeleActivLayer.empty()) if (!nextFusabeleActivLayer.empty() && nextData)
{ {
if ((!nextData->type.compare("ReLU") || if ((!nextData->type.compare("ReLU") ||
!nextData->type.compare("ReLU6") || !nextData->type.compare("ReLU6") ||
...@@ -2774,6 +2775,7 @@ struct Net::Impl : public detail::NetImplBase ...@@ -2774,6 +2775,7 @@ struct Net::Impl : public detail::NetImplBase
CV_Assert(!fuse_activation || fuse_eltwise); /* cannot fuse activation without eltwise */ CV_Assert(!fuse_activation || fuse_eltwise); /* cannot fuse activation without eltwise */
if(fuse_eltwise && fuse_activation) if(fuse_eltwise && fuse_activation)
{ {
CV_Assert(nextData);
CV_Assert_N(biasLayerData->outputBlobsWrappers.size() == 1, ld.inputBlobsWrappers.size() == 1); CV_Assert_N(biasLayerData->outputBlobsWrappers.size() == 1, ld.inputBlobsWrappers.size() == 1);
ld.inputBlobsWrappers.push_back(biasLayerData->outputBlobsWrappers[0]); ld.inputBlobsWrappers.push_back(biasLayerData->outputBlobsWrappers[0]);
printf_(("\tfused with %s\n", nextEltwiseLayer->name.c_str())); printf_(("\tfused with %s\n", nextEltwiseLayer->name.c_str()));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册