Add configure model
This commit is contained in:
parent
d09dc07a3f
commit
707d549ce8
@ -34,8 +34,8 @@ const std::vector<size_t> axis2D = {
|
||||
|
||||
const auto params2D_static = testing::Combine(
|
||||
testing::ValuesIn(netPrecisions),
|
||||
// testing::Values(InferenceEngine::Precision::UNSPECIFIED),
|
||||
// testing::Values(InferenceEngine::Precision::UNSPECIFIED),
|
||||
testing::Values(ov::element::Type_t::undefined),
|
||||
testing::Values(ov::element::Type_t::undefined),
|
||||
testing::ValuesIn(inputStaticShape2D),
|
||||
testing::ValuesIn(axis2D),
|
||||
testing::Values(CommonTestUtils::DEVICE_CPU),
|
||||
@ -44,8 +44,8 @@ const auto params2D_static = testing::Combine(
|
||||
|
||||
const auto params2D_dynamic = testing::Combine(
|
||||
testing::ValuesIn(netPrecisions),
|
||||
// testing::Values(InferenceEngine::Precision::UNSPECIFIED),
|
||||
// testing::Values(InferenceEngine::Precision::UNSPECIFIED),
|
||||
testing::Values(ov::element::Type_t::undefined),
|
||||
testing::Values(ov::element::Type_t::undefined),
|
||||
testing::ValuesIn(inputDynamicShape2D),
|
||||
testing::ValuesIn(axis2D),
|
||||
testing::Values(CommonTestUtils::DEVICE_CPU),
|
||||
@ -82,8 +82,8 @@ const std::vector<size_t> axis4D = {0, 1, 2, 3};
|
||||
|
||||
const auto params4Dstatic = testing::Combine(
|
||||
testing::ValuesIn(netPrecisions),
|
||||
// testing::Values(InferenceEngine::Precision::UNSPECIFIED),
|
||||
// testing::Values(InferenceEngine::Precision::UNSPECIFIED),
|
||||
testing::Values(ov::element::Type_t::undefined),
|
||||
testing::Values(ov::element::Type_t::undefined),
|
||||
testing::ValuesIn(inputStaticShape4D),
|
||||
testing::ValuesIn(axis4D),
|
||||
testing::Values(CommonTestUtils::DEVICE_CPU),
|
||||
@ -92,8 +92,8 @@ const auto params4Dstatic = testing::Combine(
|
||||
|
||||
const auto params4Ddynamic = testing::Combine(
|
||||
testing::ValuesIn(netPrecisions),
|
||||
// testing::Values(InferenceEngine::Precision::UNSPECIFIED),
|
||||
// testing::Values(InferenceEngine::Precision::UNSPECIFIED),
|
||||
testing::Values(ov::element::Type_t::undefined),
|
||||
testing::Values(ov::element::Type_t::undefined),
|
||||
testing::ValuesIn(inputDynamicShape4D),
|
||||
testing::ValuesIn(axis4D),
|
||||
testing::Values(CommonTestUtils::DEVICE_CPU),
|
||||
|
@ -68,7 +68,7 @@ protected:
|
||||
//
|
||||
//#endif
|
||||
|
||||
// virtual void configure_model();
|
||||
virtual void configure_model();
|
||||
|
||||
virtual void compile_model();
|
||||
virtual void generate_inputs(const std::vector<ngraph::Shape>& targetInputStaticShapes);
|
||||
@ -86,8 +86,8 @@ protected:
|
||||
|
||||
std::shared_ptr<ngraph::Function> function;
|
||||
std::shared_ptr<ngraph::Function> functionRefs;
|
||||
ov::element::Type inPrc;
|
||||
ov::element::Type outPrc;
|
||||
ov::element::Type_t inType;
|
||||
ov::element::Type_t outType;
|
||||
std::map<std::string, ov::runtime::Tensor> inputs;
|
||||
std::vector<ngraph::PartialShape> inputDynamicShapes;
|
||||
std::vector<std::vector<ngraph::Shape>> targetStaticShapes;
|
||||
|
@ -18,8 +18,8 @@ namespace LayerTestsDefinitions {
|
||||
|
||||
using softMaxLayerTestParams = std::tuple<
|
||||
ngraph::element::Type_t, // netPrecision
|
||||
// ngraph::element::Type, // Input precision
|
||||
// ngraph::element::Type, // Output precision
|
||||
ngraph::element::Type_t, // Input precision
|
||||
ngraph::element::Type_t, // Output precision
|
||||
// InferenceEngine::Layout, // Input layout
|
||||
// InferenceEngine::Layout, // Output layout
|
||||
std::pair<ov::PartialShape, std::vector<ov::Shape>>, // Dynamic shape + Target static shapes
|
||||
|
@ -76,8 +76,8 @@ void SubgraphBaseTest::serialize() {
|
||||
std::string out_xml_path = output_name + ".xml";
|
||||
std::string out_bin_path = output_name + ".bin";
|
||||
|
||||
ngraph::pass::Manager manager;
|
||||
manager.register_pass<ngraph::pass::Serialize>(out_xml_path, out_bin_path);
|
||||
ov::pass::Manager manager;
|
||||
manager.register_pass<ov::pass::serialize>(out_xml_path, out_bin_path);
|
||||
manager.run_passes(function);
|
||||
function->validate_nodes_and_infer_types();
|
||||
|
||||
@ -140,26 +140,30 @@ void SubgraphBaseTest::compare(const std::vector<ov::runtime::Tensor> &expected,
|
||||
// ASSERT_EQ(expected.get_shape(), actual.get_shape());
|
||||
//}
|
||||
|
||||
//void SubgraphBaseTest::configure_model() {
|
||||
// // configure input precision
|
||||
// {
|
||||
// auto params = function->get_parameters();
|
||||
// for (auto& param : params) {
|
||||
// param->get_output_tensor(0).set_element_type(inPrc);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// // configure output precision
|
||||
// {
|
||||
// auto results = function->get_results();
|
||||
// for (auto& result : results) {
|
||||
// result->get_output_tensor(0).set_element_type(outPrc);
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
void SubgraphBaseTest::configure_model() {
|
||||
// configure input precision
|
||||
{
|
||||
auto params = function->get_parameters();
|
||||
for (auto& param : params) {
|
||||
if (inType != ov::element::Type_t::undefined) {
|
||||
param->get_output_tensor(0).set_element_type(inType);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// configure output precision
|
||||
{
|
||||
auto results = function->get_results();
|
||||
for (auto& result : results) {
|
||||
if (outType != ov::element::Type_t::undefined) {
|
||||
result->get_output_tensor(0).set_element_type(outType);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SubgraphBaseTest::compile_model() {
|
||||
// configure_model();
|
||||
configure_model();
|
||||
executableNetwork = core->compile_model(function, targetDevice, configuration);
|
||||
}
|
||||
|
||||
@ -180,7 +184,7 @@ void SubgraphBaseTest::infer() {
|
||||
}
|
||||
inferRequest.infer();
|
||||
}
|
||||
//
|
||||
|
||||
std::vector<ov::runtime::Tensor> SubgraphBaseTest::calculate_refs() {
|
||||
// nGraph interpreter does not support f16/bf16
|
||||
ngraph::pass::ConvertPrecision<element::Type_t::f16, element::Type_t::f32>().run_on_function(function);
|
||||
@ -193,7 +197,7 @@ std::vector<ov::runtime::Tensor> SubgraphBaseTest::calculate_refs() {
|
||||
auto expectedOutputs = ngraph::helpers::interpreterFunction(function, referenceInputs);
|
||||
return expectedOutputs;
|
||||
}
|
||||
//
|
||||
|
||||
std::vector<ov::runtime::Tensor> SubgraphBaseTest::get_outputs() {
|
||||
auto outputs = std::vector<ov::runtime::Tensor>{};
|
||||
for (const auto& output : executableNetwork.get_results()) {
|
||||
|
@ -7,18 +7,17 @@
|
||||
namespace LayerTestsDefinitions {
|
||||
|
||||
std::string SoftMaxLayerTest::getTestCaseName(const testing::TestParamInfo<softMaxLayerTestParams>& obj) {
|
||||
ngraph::element::Type_t netPrecision;
|
||||
// InferenceEngine::Precision inPrc, outPrc;
|
||||
ov::element::Type_t netType, inType, outType;
|
||||
std::pair<ngraph::PartialShape, std::vector<ngraph::Shape>> shapes;
|
||||
size_t axis;
|
||||
std::string targetDevice;
|
||||
std::map<std::string, std::string> config;
|
||||
std::tie(netPrecision, shapes, axis, targetDevice, config) = obj.param;
|
||||
std::tie(netType, inType, outType, shapes, axis, targetDevice, config) = obj.param;
|
||||
|
||||
std::ostringstream result;
|
||||
result << "netPRC=" << netPrecision << "_";
|
||||
// result << "inPRC=" << inPrc.name() << "_";
|
||||
// result << "outPRC=" << outPrc.name() << "_";
|
||||
result << "NetType=" << netType << "_";
|
||||
result << "InType=" << inType << "_";
|
||||
result << "OutType=" << outType << "_";
|
||||
result << "IS=" << CommonTestUtils::partialShape2str({shapes.first}) << "_";
|
||||
result << "TS=";
|
||||
for (const auto& item : shapes.second) {
|
||||
@ -35,7 +34,7 @@ void SoftMaxLayerTest::SetUp() {
|
||||
ngraph::element::Type_t ngPrc;
|
||||
size_t axis;
|
||||
|
||||
std::tie(ngPrc, shapes, axis, targetDevice, configuration) = GetParam();
|
||||
std::tie(ngPrc, inType, outType, shapes, axis, targetDevice, configuration) = GetParam();
|
||||
init_input_shapes(shapes);
|
||||
|
||||
const auto params = ngraph::builder::makeDynamicParams(ngPrc, inputDynamicShapes);
|
||||
|
Loading…
Reference in New Issue
Block a user