[IE][VPU][DTS][Tests]: Remove WAs for networks with multiple outputs (#2828)

* Remove WAs for networks with multiple outputs
This commit is contained in:
Andrew Bakalin 2020-10-29 13:44:52 +03:00 committed by GitHub
parent d14a7939a6
commit 4043413529
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 41 deletions

View 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");

View 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");
}

View 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");
}

View 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");
}