Output blobs shapes initialization in case of identity permutation (NCHW->NCHW)

pull/9874/head
Dmitry Kurtaev 7 years ago
parent 110af09bf9
commit a3a446c197
  1. 9
      modules/dnn/src/layers/permute_layer.cpp

@ -117,7 +117,10 @@ public:
std::vector<MatShape> &internals) const
{
if(!_needsPermute)
{
Layer::getMemoryShapes(inputs, requiredOutputs, outputs, internals);
return true;
}
CV_Assert(inputs.size() > 0);
CV_Assert((int)_numAxes == inputs[0].size());
@ -253,7 +256,11 @@ public:
if(!_needsPermute)
{
for (k = 0; k < ninputs; k++)
outputs[k] = *inputs[k];
{
CV_Assert(outputs[k].total() == inputs[k]->total());
if (outputs[k].data != inputs[k]->data)
inputs[k]->copyTo(outputs[k]);
}
}
else
{

Loading…
Cancel
Save