mirror of
https://github.com/opencv/opencv.git
synced 2026-07-30 15:53:03 +04:00
Merge pull request #11567 from alalek:code_quality
This commit is contained in:
@@ -1530,10 +1530,12 @@ struct Net::Impl
|
||||
LayerData *eltwiseData = nextData;
|
||||
// go down from the second input and find the first non-skipped layer.
|
||||
LayerData *downLayerData = &layers[eltwiseData->inputBlobsId[1].lid];
|
||||
CV_Assert(downLayerData);
|
||||
while (downLayerData->skip)
|
||||
{
|
||||
downLayerData = &layers[downLayerData->inputBlobsId[0].lid];
|
||||
}
|
||||
CV_Assert(downLayerData);
|
||||
|
||||
// second input layer is current layer.
|
||||
if ( ld.id == downLayerData->id )
|
||||
@@ -1548,9 +1550,7 @@ struct Net::Impl
|
||||
downLayerData = &layers[downLayerData->inputBlobsId[0].lid];
|
||||
}
|
||||
|
||||
Ptr<ConvolutionLayer> convLayer;
|
||||
if( downLayerData )
|
||||
convLayer = downLayerData->layerInstance.dynamicCast<ConvolutionLayer>();
|
||||
Ptr<ConvolutionLayer> convLayer = downLayerData->layerInstance.dynamicCast<ConvolutionLayer>();
|
||||
|
||||
// first input layer is convolution layer
|
||||
if( !convLayer.empty() && eltwiseData->consumers.size() == 1 )
|
||||
|
||||
@@ -119,9 +119,10 @@ public:
|
||||
if (blobs.size() > 3)
|
||||
{
|
||||
CV_Assert(blobs.size() == 6);
|
||||
const int N = Wh.cols;
|
||||
for (int i = 3; i < 6; ++i)
|
||||
{
|
||||
CV_Assert(blobs[i].rows == Wh.cols && blobs[i].cols == Wh.cols);
|
||||
CV_Assert(blobs[i].rows == N && blobs[i].cols == N);
|
||||
CV_Assert(blobs[i].type() == bias.type());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -504,7 +504,7 @@ static bool ocl4dnnFastBufferGEMM(const CBLAS_TRANSPOSE TransA,
|
||||
oclk_gemm_float.set(arg_idx++, (float)alpha);
|
||||
oclk_gemm_float.set(arg_idx++, (float)beta);
|
||||
|
||||
bool ret;
|
||||
bool ret = true;
|
||||
if (TransB == CblasNoTrans || TransA != CblasNoTrans) {
|
||||
int stride = 256;
|
||||
for (int start_index = 0; start_index < K; start_index += stride) {
|
||||
|
||||
Reference in New Issue
Block a user