[IE][VPU][DTS][Tests]: Remove WAs for networks with multiple outputs (#2828)
authorAndrew Bakalin <andrew.bakalin@intel.com>
Thu, 29 Oct 2020 10:44:52 +0000 (13:44 +0300)
committerGitHub <noreply@github.com>
Thu, 29 Oct 2020 10:44:52 +0000 (13:44 +0300)
* Remove WAs for networks with multiple outputs

inference-engine/tests/functional/plugin/myriad/ngraph/transformations/dynamic_to_static_shape_non_max_suppression.cpp
inference-engine/tests/functional/plugin/myriad/ngraph/transformations/dynamic_to_static_shape_split.cpp
inference-engine/tests/functional/plugin/myriad/ngraph/transformations/dynamic_to_static_shape_topk.cpp
inference-engine/tests/functional/plugin/myriad/ngraph/transformations/dynamic_to_static_shape_variadic_split.cpp

index fcfaae1..d8a7155 100644 (file)
@@ -64,7 +64,7 @@ protected:
                 boxes, dsr, maxOutputBoxesPerClass, iouThreshold, scoreThreshold, softNMSSigma);
 
         const auto function = std::make_shared<ngraph::Function>(
-                ngraph::OutputVector{node->outputs()},
+                node->outputs(),
                 ngraph::ParameterVector{boxes, scores, dims},
                 "Actual");
 
index 7079e72..0aa361c 100644 (file)
@@ -65,12 +65,9 @@ std::shared_ptr<const ngraph::Function> transform(
     const auto dsr = std::make_shared<ngraph::vpu::op::DynamicShapeResolver>(data, dims);
     const auto node = std::make_shared<ngraph::opset5::Split>(dsr, axis, splitSetup.numSplits);
 
-    // tests are capable to compare functions with one result only
-    const auto testsWa = std::make_shared<ngraph::opset5::Concat>(node->outputs(), splitSetup.axis);
-
     auto outputShape = node->get_output_partial_shape(0);
     const auto function = std::make_shared<ngraph::Function>(
-            ngraph::NodeVector{testsWa},
+            node->outputs(),
             ngraph::ParameterVector{data, dims},
             "Actual");
     node->set_output_type(0, dsr->get_input_element_type(0), ngraph::PartialShape::dynamic(splitSetup.dataShape.size()));
@@ -108,11 +105,8 @@ std::shared_ptr<const ngraph::Function> reference(
         results.push_back(std::make_shared<ngraph::vpu::op::DynamicShapeResolver>(node->output(i), newShape));
     }
 
-    // tests are capable to compare functions with one result only
-    const auto testsWa = std::make_shared<ngraph::opset5::Concat>(results, splitSetup.axis);
-
     return std::make_shared<ngraph::Function>(
-            testsWa,
+            results,
             ngraph::ParameterVector{data, dims},
             "Expected");
 }
index 7be177a..8b1d3aa 100644 (file)
@@ -72,16 +72,9 @@ protected:
         const auto dsr = std::make_shared<ngraph::vpu::op::DynamicShapeResolver>(data, dims);
         const auto node = std::make_shared<ngraph::opset3::TopK>(dsr, k, topk_setup.axis, "max", "value");
 
-        // tests are capable to compare functions with one result only, but TopK has 2 of them  and they are of different types
-        ngraph::OutputVector converted;
-        for (const auto& result : {node->output(0), node->output(1)}) {
-            converted.push_back(std::make_shared<ngraph::opset3::Convert>(result, ngraph::element::f32));
-        }
-        const auto tests_wa = std::make_shared<ngraph::opset3::Concat>(converted, topk_setup.axis);
-
         auto outputShape = node->get_output_partial_shape(0);
         const auto function = std::make_shared<ngraph::Function>(
-            ngraph::NodeVector{tests_wa},
+            node->outputs(),
             ngraph::ParameterVector{data, dims},
             "Actual");
         node->set_output_type(0, dsr->get_input_element_type(0), ngraph::PartialShape::dynamic(topk_setup.data_shape.size()));
@@ -140,13 +133,8 @@ protected:
             results.push_back(std::make_shared<ngraph::vpu::op::DynamicShapeResolver>(node->output(0), k_1D));
             results.push_back(std::make_shared<ngraph::vpu::op::DynamicShapeResolver>(node->output(1), k_1D));
         }
-        // tests are capable to compare functions with one result only, but TopK has 2 of them  and they are of different types
-        for (const auto& result : results) {
-            converted.push_back(std::make_shared<ngraph::opset3::Convert>(result, ngraph::element::f32));
-        }
-        const auto tests_wa = std::make_shared<ngraph::opset3::Concat>(converted, topk_setup.axis);
         return std::make_shared<ngraph::Function>(
-            tests_wa,
+            results,
             ngraph::ParameterVector{data, dims},
             "Expected");
     }
@@ -189,16 +177,9 @@ protected:
         const auto dsr = std::make_shared<ngraph::vpu::op::DynamicShapeResolver>(data, dims);
         const auto node = std::make_shared<ngraph::opset3::TopK>(dsr, k, topk_setup.axis, "max", "value");
 
-        // tests are capable to compare functions with one result only, but TopK has 2 of them  and they are of different types
-        ngraph::OutputVector converted;
-        for (const auto& result : {node->output(0), node->output(1)}) {
-            converted.push_back(std::make_shared<ngraph::opset3::Convert>(result, ngraph::element::f32));
-        }
-        const auto tests_wa = std::make_shared<ngraph::opset3::Concat>(converted, topk_setup.axis);
-
         auto outputShape = node->get_output_partial_shape(0);
         const auto function = std::make_shared<ngraph::Function>(
-            ngraph::NodeVector{tests_wa},
+            node->outputs(),
             ngraph::ParameterVector{data, dims},
             "Actual");
         node->set_output_type(0, dsr->get_input_element_type(0), ngraph::PartialShape::dynamic(topk_setup.data_shape.size()));
@@ -263,12 +244,8 @@ protected:
             results.push_back(std::make_shared<ngraph::vpu::op::DynamicShapeResolver>(node->output(1), k_1D));
         }
 
-        // tests are capable to compare functions with one result only, but TopK has 2 of them and they are of different types
-        for (const auto& result : results)
-            converted.push_back(std::make_shared<ngraph::opset3::Convert>(result, ngraph::element::f32));
-        const auto tests_wa = std::make_shared<ngraph::opset3::Concat>(converted, topk_setup.axis);
         return std::make_shared<ngraph::Function>(
-            tests_wa,
+            results,
             ngraph::ParameterVector{data, dims},
             "Expected");
     }
index bbb9948..79e913d 100644 (file)
@@ -74,11 +74,9 @@ protected:
         const auto dsr = std::make_shared<ngraph::vpu::op::DynamicShapeResolver>(data, dims);
         const auto node = std::make_shared<ngraph::opset3::VariadicSplit>(dsr, axis, split_lengths);
 
-        const auto tests_wa = std::make_shared<ngraph::opset3::Concat>(node->outputs(), variadic_split_setup.axis);
-
         auto outputShape = node->get_output_partial_shape(0);
         const auto function = std::make_shared<ngraph::Function>(
-            ngraph::NodeVector{tests_wa},
+            node->outputs(),
             ngraph::ParameterVector{data, dims},
             "Actual");
         node->set_output_type(0, dsr->get_input_element_type(0), ngraph::PartialShape::dynamic(variadic_split_setup.data_shape.size()));
@@ -134,10 +132,9 @@ protected:
                 results.push_back(std::make_shared<ngraph::vpu::op::DynamicShapeResolver>(node->output(i), dim));
             }
         }
-        const auto tests_wa = std::make_shared<ngraph::opset3::Concat>(results, variadic_split_setup.axis);
 
         return std::make_shared<ngraph::Function>(
-            tests_wa,
+            results,
             ngraph::ParameterVector{data, dims},
             "Expected");
     }