Merge pull request #1097 from arrybn:issue_1007

pull/1101/head
Alexander Alekhin 8 years ago
commit 9c96a8114e
  1. 8
      modules/dnn/src/layers/padding_layer.cpp

@ -63,12 +63,12 @@ void PaddingLayer::forward(std::vector<Blob*> &inputs, std::vector<Blob> &output
std::vector<Range> srcRanges(inShape.dims(), Range::all()), dstRanges = srcRanges;
for(int i = 0; i < srcDstRanges.size(); i++)
for(int j = 0; j < srcDstRanges.size(); j++)
{
if(!srcDstRanges[i].first.empty())
if(!srcDstRanges[j].first.empty())
{
srcRanges[dim] = srcDstRanges[i].first;
dstRanges[dim] = srcDstRanges[i].second;
srcRanges[dim] = srcDstRanges[j].first;
dstRanges[dim] = srcDstRanges[j].second;
Mat dst = outputs[i].matRef()(&dstRanges[0]);
Mat src = inputs[i]->matRef()(&srcRanges[0]).clone();
src.copyTo(dst);

Loading…
Cancel
Save