Commit a3a446c1 authored by Dmitry Kurtaev's avatar Dmitry Kurtaev

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

parent 110af09b
......@@ -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
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment