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

This commit is contained in:
Dmitry Kurtaev 2017-10-17 17:13:33 +03:00
parent 110af09bf9
commit a3a446c197

View File

@ -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
{