Merge pull request #20647 from rogday:resize_concat_optimization

Fix resize+concat optimization

* fix resize+concat optimization

* add comment and fix indentation
This commit is contained in:
rogday 2021-09-03 15:32:29 +03:00 committed by GitHub
parent 7c23ec90a9
commit d0e612dc36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 0 deletions

View File

@ -111,7 +111,14 @@ public:
internals_arr.getMatVector(internals);
if (outHeight == inputs[0].size[2] && outWidth == inputs[0].size[3])
{
// outputs[0] = inputs[0] doesn't work due to BlobManager optimizations
if (inputs[0].data != outputs[0].data)
{
inputs[0].copyTo(outputs[0]);
}
return;
}
Mat& inp = inputs[0];
Mat& out = outputs[0];

View File

@ -1125,6 +1125,11 @@ TEST_P(Test_TensorFlow_layers, resize_bilinear_down)
runTensorFlowNet("resize_bilinear_down");
}
TEST_P(Test_TensorFlow_layers, resize_concat_optimization)
{
runTensorFlowNet("resize_concat_optimization");
}
TEST_P(Test_TensorFlow_layers, tf2_dense)
{
runTensorFlowNet("tf2_dense");