From 0a1d89c3740cff2db99a92a5e1d283df9c6d9f74 Mon Sep 17 00:00:00 2001 From: Mateusz Bencer Date: Tue, 7 Mar 2023 16:50:17 +0100 Subject: [PATCH 01/28] [ONNX FE] Remove ignoring win warnings --- src/frontends/onnx/frontend/CMakeLists.txt | 6 ------ src/frontends/onnx/tests/CMakeLists.txt | 7 ------- 2 files changed, 13 deletions(-) diff --git a/src/frontends/onnx/frontend/CMakeLists.txt b/src/frontends/onnx/frontend/CMakeLists.txt index 67b48262131fd9..5c467f48a69877 100644 --- a/src/frontends/onnx/frontend/CMakeLists.txt +++ b/src/frontends/onnx/frontend/CMakeLists.txt @@ -2,12 +2,6 @@ # SPDX-License-Identifier: Apache-2.0 # -if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") - ie_add_compiler_flags(/wd4267) - ie_add_compiler_flags(/wd4018) - ie_add_compiler_flags(/wd4244) -endif() - ov_add_frontend(NAME onnx LINKABLE_FRONTEND PROTOBUF_LITE diff --git a/src/frontends/onnx/tests/CMakeLists.txt b/src/frontends/onnx/tests/CMakeLists.txt index 957c42ccc0522c..4828aad1e2c8f2 100644 --- a/src/frontends/onnx/tests/CMakeLists.txt +++ b/src/frontends/onnx/tests/CMakeLists.txt @@ -6,13 +6,6 @@ set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE OFF) ov_try_use_gold_linker() -if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") - ie_add_compiler_flags(/wd4244) - ie_add_compiler_flags(/wd4267) - ie_add_compiler_flags(/wd4305) - ie_add_compiler_flags(/wd4756) -endif() - message(STATUS "ONNX frontend test enabled") add_compile_definitions( From daf220119064a7a0044cb8d0b5cb2a461c8779ef Mon Sep 17 00:00:00 2001 From: Mateusz Bencer Date: Tue, 14 Mar 2023 09:24:34 +0100 Subject: [PATCH 02/28] fix win warnings --- src/frontends/onnx/frontend/src/core/graph.cpp | 7 ++++--- src/frontends/onnx/frontend/src/editor.cpp | 5 +++-- src/frontends/onnx/frontend/src/op/roi_align.cpp | 7 ++++--- src/frontends/onnx/frontend/src/place.cpp | 4 ++-- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/frontends/onnx/frontend/src/core/graph.cpp b/src/frontends/onnx/frontend/src/core/graph.cpp index e940c172e87eec..5142b86e54ad9b 100644 --- a/src/frontends/onnx/frontend/src/core/graph.cpp +++ b/src/frontends/onnx/frontend/src/core/graph.cpp @@ -328,7 +328,7 @@ std::shared_ptr Graph::create_function() { const auto& onnx_outputs = m_model->get_graph().output(); for (std::size_t i{0}; i < function->get_output_size(); ++i) { const auto& result_node = function->get_output_op(i); - const std::string onnx_output_name = onnx_outputs.Get(i).name(); + const std::string onnx_output_name = onnx_outputs.Get(static_cast(i)).name(); result_node->set_friendly_name(onnx_output_name + "/sink_port_0"); const auto& previous_operation = result_node->get_input_node_shared_ptr(0); previous_operation->set_friendly_name(onnx_output_name); @@ -386,7 +386,7 @@ OutputVector Graph::make_ng_nodes(const Node& onnx_node) { const size_t outputs_size = std::accumulate(std::begin(ng_subgraph_outputs), std::end(ng_subgraph_outputs), - 0, + static_cast(0), [](const size_t lhs, const Output& rhs) { return lhs + rhs.get_node()->get_output_size(); }); @@ -420,7 +420,8 @@ void Graph::set_friendly_names(const Node& onnx_node, const OutputVector& ng_sub const auto common_node = detail::common_node_for_all_outputs(ng_subgraph_outputs); - for (size_t i = 0; i < ng_subgraph_outputs.size(); ++i) { + const auto ng_subgraph_output_size = static_cast(ng_subgraph_outputs.size()); + for (int i = 0; i < ng_subgraph_output_size; ++i) { // Trailing optional outputs may not be specified in the ONNX model. // Other optional outputs should have name set to an empty string. if (i >= onnx_node.get_outputs_size()) { diff --git a/src/frontends/onnx/frontend/src/editor.cpp b/src/frontends/onnx/frontend/src/editor.cpp index 7b0d55007e9363..9da954529ffaf2 100644 --- a/src/frontends/onnx/frontend/src/editor.cpp +++ b/src/frontends/onnx/frontend/src/editor.cpp @@ -214,9 +214,10 @@ void graph_topological_sort(GraphProto* graph) { std::multimap output_name_to_node; GraphProto result; - for (int i = 0; i < graph->node().size(); ++i) { + const auto nodes_number = static_cast(graph->node().size()); + for (int i = 0; i < nodes_number; ++i) { for (const auto& output_name : graph->node(i).output()) { - output_name_to_node.emplace(output_name, graph->mutable_node(static_cast(i))); + output_name_to_node.emplace(output_name, graph->mutable_node(i)); } } auto get_node_by_out_name = [&output_name_to_node](const std::string& out_name) -> const NodeProto* { diff --git a/src/frontends/onnx/frontend/src/op/roi_align.cpp b/src/frontends/onnx/frontend/src/op/roi_align.cpp index 9b6959e126c38a..8d803c3bd30bb7 100644 --- a/src/frontends/onnx/frontend/src/op/roi_align.cpp +++ b/src/frontends/onnx/frontend/src/op/roi_align.cpp @@ -68,12 +68,13 @@ OutputVector roi_align(const Node& node) { return {std::make_shared(data, rois, num_rois, - pooled_h, - pooled_w, - sampling_ratio, + static_cast(pooled_h), + static_cast(pooled_w), + static_cast(sampling_ratio), spatial_scale, pooling_mode, aligned_mode)}; + //return {}; } } // namespace set_16 diff --git a/src/frontends/onnx/frontend/src/place.cpp b/src/frontends/onnx/frontend/src/place.cpp index 6b67cf7efcfd03..3430bf4e6b56cb 100644 --- a/src/frontends/onnx/frontend/src/place.cpp +++ b/src/frontends/onnx/frontend/src/place.cpp @@ -317,8 +317,8 @@ ov::frontend::Place::Ptr PlaceOp::get_input_port(const std::string& input_name) std::vector PlaceOp::get_consuming_ports() const { std::vector consuming_ports; - const auto out_ports_number = m_editor->get_output_ports(m_node).size(); - for (size_t out_idx = 0; out_idx < out_ports_number; ++out_idx) { + const auto out_ports_number = static_cast(m_editor->get_output_ports(m_node).size()); + for (int out_idx = 0; out_idx < out_ports_number; ++out_idx) { auto consuming_ops_out = get_output_port(out_idx)->get_consuming_ports(); consuming_ports.insert(consuming_ports.end(), consuming_ops_out.begin(), consuming_ops_out.end()); } From 1e523ececf87707728339384a7b220c9c7f0d320 Mon Sep 17 00:00:00 2001 From: Mateusz Bencer Date: Tue, 14 Mar 2023 09:25:46 +0100 Subject: [PATCH 03/28] removed test code --- src/frontends/onnx/frontend/src/op/roi_align.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/frontends/onnx/frontend/src/op/roi_align.cpp b/src/frontends/onnx/frontend/src/op/roi_align.cpp index 8d803c3bd30bb7..6773806fe993a7 100644 --- a/src/frontends/onnx/frontend/src/op/roi_align.cpp +++ b/src/frontends/onnx/frontend/src/op/roi_align.cpp @@ -74,7 +74,6 @@ OutputVector roi_align(const Node& node) { spatial_scale, pooling_mode, aligned_mode)}; - //return {}; } } // namespace set_16 From 226d29e3324769fed6fcb6d5fd9e0599a12e7c3c Mon Sep 17 00:00:00 2001 From: Mateusz Bencer Date: Tue, 14 Mar 2023 10:31:10 +0100 Subject: [PATCH 04/28] add additional static__cast --- src/frontends/onnx/frontend/src/core/graph.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontends/onnx/frontend/src/core/graph.cpp b/src/frontends/onnx/frontend/src/core/graph.cpp index 5142b86e54ad9b..5d46da8805efe1 100644 --- a/src/frontends/onnx/frontend/src/core/graph.cpp +++ b/src/frontends/onnx/frontend/src/core/graph.cpp @@ -424,7 +424,7 @@ void Graph::set_friendly_names(const Node& onnx_node, const OutputVector& ng_sub for (int i = 0; i < ng_subgraph_output_size; ++i) { // Trailing optional outputs may not be specified in the ONNX model. // Other optional outputs should have name set to an empty string. - if (i >= onnx_node.get_outputs_size()) { + if (i >= static_cast(onnx_node.get_outputs_size())) { break; } From c6b3e1acbf67a71c0487d546202ad70a1457c57e Mon Sep 17 00:00:00 2001 From: Mateusz Bencer Date: Tue, 14 Mar 2023 13:19:55 +0100 Subject: [PATCH 05/28] fix warning in tests --- src/frontends/onnx/tests/onnx_import_quant.in.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontends/onnx/tests/onnx_import_quant.in.cpp b/src/frontends/onnx/tests/onnx_import_quant.in.cpp index 784bb8a0ae2ad3..bd973328ee10ab 100644 --- a/src/frontends/onnx/tests/onnx_import_quant.in.cpp +++ b/src/frontends/onnx/tests/onnx_import_quant.in.cpp @@ -1061,7 +1061,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_fake_quantize_const_inputs_infer) { const Shape data_shape{1, 2, 3, 4}; const auto n_elements = shape_size(data_shape); std::vector input_data(n_elements); - std::iota(std::begin(input_data), std::end(input_data), 0); + std::iota(std::begin(input_data), std::end(input_data), 0.f); auto test_case = test::TestCase(function, s_device); test_case.add_input(input_data); From 6b47a95118f131dbea937f10750b38b5b6ebc85a Mon Sep 17 00:00:00 2001 From: Mateusz Bencer Date: Tue, 14 Mar 2023 16:09:09 +0100 Subject: [PATCH 06/28] fix next warning in tests --- src/frontends/onnx/tests/onnx_import_quant.in.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontends/onnx/tests/onnx_import_quant.in.cpp b/src/frontends/onnx/tests/onnx_import_quant.in.cpp index bd973328ee10ab..d49b96c22b7f91 100644 --- a/src/frontends/onnx/tests/onnx_import_quant.in.cpp +++ b/src/frontends/onnx/tests/onnx_import_quant.in.cpp @@ -1081,7 +1081,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_fake_quantize_nonconst_inputs_infer) { const Shape data_shape{1, 2, 3, 4}; const size_t n_elements = shape_size(data_shape); std::vector input_data(n_elements); - std::iota(std::begin(input_data), std::end(input_data), 0); + std::iota(std::begin(input_data), std::end(input_data), 0.f); auto test_case = test::TestCase(function, s_device); test_case.add_input(input_data); From 2f0b6f32aaae6a6ee2f5c4ebe68116924b1ad136 Mon Sep 17 00:00:00 2001 From: Mateusz Bencer Date: Tue, 14 Mar 2023 22:04:57 +0100 Subject: [PATCH 07/28] fixed floats in reshape tests --- .../onnx/tests/onnx_import_reshape.in.cpp | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/frontends/onnx/tests/onnx_import_reshape.in.cpp b/src/frontends/onnx/tests/onnx_import_reshape.in.cpp index 771000f8091db8..d75c0a3b57b992 100644 --- a/src/frontends/onnx/tests/onnx_import_reshape.in.cpp +++ b/src/frontends/onnx/tests/onnx_import_reshape.in.cpp @@ -129,29 +129,29 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_reshape_negative_dim) { "onnx/reshape_negative_dim.onnx")); // 2x3x4 - auto input = test::NDArray({{{0.5488135, 0.71518934, 0.60276335, 0.5448832}, - {0.4236548, 0.6458941, 0.4375872, 0.891773}, - {0.96366274, 0.3834415, 0.79172504, 0.5288949}}, + auto input = test::NDArray({{{0.5488135f, 0.71518934f, 0.60276335f, 0.5448832f}, + {0.4236548f, 0.6458941f, 0.4375872f, 0.891773f}, + {0.96366274f, 0.3834415f, 0.79172504f, 0.5288949f}}, - {{0.56804454, 0.92559665, 0.07103606, 0.0871293}, - {0.0202184, 0.83261985, 0.77815676, 0.87001216}, - {0.9786183, 0.7991586, 0.46147937, 0.7805292}}}) + {{0.56804454f, 0.92559665f, 0.07103606f, 0.0871293f}, + {0.0202184f, 0.83261985f, 0.77815676f, 0.87001216f}, + {0.9786183f, 0.7991586f, 0.46147937f, 0.7805292f}}}) .get_vector(); // 2x6x2 - auto expected_output = test::NDArray({{{0.5488135, 0.71518934}, - {0.60276335, 0.5448832}, - {0.4236548, 0.6458941}, - {0.4375872, 0.891773}, - {0.96366274, 0.3834415}, - {0.79172504, 0.5288949}}, - - {{0.56804454, 0.92559665}, - {0.07103606, 0.0871293}, - {0.0202184, 0.83261985}, - {0.77815676, 0.87001216}, - {0.9786183, 0.7991586}, - {0.46147937, 0.7805292}}}) + auto expected_output = test::NDArray({{{0.5488135f, 0.71518934f}, + {0.60276335f, 0.5448832f}, + {0.4236548f, 0.6458941f}, + {0.4375872f, 0.891773f}, + {0.96366274f, 0.3834415f}, + {0.79172504f, 0.5288949f}}, + + {{0.56804454f, 0.92559665f}, + {0.07103606f, 0.0871293f}, + {0.0202184f, 0.83261985f}, + {0.77815676f, 0.87001216f}, + {0.9786183f, 0.7991586f}, + {0.46147937f, 0.7805292f}}}) .get_vector(); auto test_case = test::TestCase(function, s_device); From 5ab34e0c0cb32510f3e057f0f421d57c9536bb64 Mon Sep 17 00:00:00 2001 From: Mateusz Bencer Date: Tue, 14 Mar 2023 23:00:13 +0100 Subject: [PATCH 08/28] fix float conversion for const folding tests --- src/frontends/onnx/tests/onnx_import_const_folding.in.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontends/onnx/tests/onnx_import_const_folding.in.cpp b/src/frontends/onnx/tests/onnx_import_const_folding.in.cpp index 1c9a1054bf674d..a6c151d0ee526d 100644 --- a/src/frontends/onnx/tests/onnx_import_const_folding.in.cpp +++ b/src/frontends/onnx/tests/onnx_import_const_folding.in.cpp @@ -56,7 +56,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_const_folding_model_scatter_elements) { SERIALIZED_ZOO, "onnx/scatter_elements_opset11.onnx")); - test_constant_folding(fn, {1.0, 1.1, 3.0, 2.1, 5.0}, Shape{1, 5}); + test_constant_folding(fn, {1.0f, 1.1f, 3.0f, 2.1f, 5.0f}, Shape{1, 5}); } NGRAPH_TEST(${BACKEND_NAME}, onnx_const_folding_model_non_zero_scalar) { From 15a88c457515714e221829f847ae1238c6dd53cc Mon Sep 17 00:00:00 2001 From: Mateusz Bencer Date: Wed, 15 Mar 2023 09:37:05 +0100 Subject: [PATCH 09/28] fixed float in controlflow --- src/frontends/onnx/tests/onnx_import_controlflow.in.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/frontends/onnx/tests/onnx_import_controlflow.in.cpp b/src/frontends/onnx/tests/onnx_import_controlflow.in.cpp index 0c1d0648d8abee..6908c0b9992251 100644 --- a/src/frontends/onnx/tests/onnx_import_controlflow.in.cpp +++ b/src/frontends/onnx/tests/onnx_import_controlflow.in.cpp @@ -769,8 +769,9 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_if_with_only_indentity_in_else_branch) { std::vector x(shape_size(Shape{1, 5, 2, 2})); std::iota(x.begin(), x.end(), 0); - std::vector expected{1.333333, 3, 4.666666, 6.333333, 8, 10, 12, 14, 16, 18, - 20, 22, 24, 26, 28, 30, 25.33333, 27, 28.666667, 30.33333}; + std::vector expected{1.333333f, 3.f, 4.666666f, 6.333333f, 8.f, 10.f, 12.f, + 14.f, 16.f, 18.f, 20.f, 22.f, 24.f, 26.f, + 28.f, 30.f, 25.33333f, 27.f, 28.666667f, 30.33333f}; test_case.add_input(x); test_case.add_expected_output(expected); test_case.run(); From ba1ade43b11c4f132cfb65dd32072ddf50de377f Mon Sep 17 00:00:00 2001 From: Mateusz Bencer Date: Wed, 15 Mar 2023 13:27:29 +0100 Subject: [PATCH 10/28] fixed double->float cast for microsoft tests --- .../tests/onnx_import_com_microsoft.in.cpp | 1031 +++++++++-------- 1 file changed, 525 insertions(+), 506 deletions(-) diff --git a/src/frontends/onnx/tests/onnx_import_com_microsoft.in.cpp b/src/frontends/onnx/tests/onnx_import_com_microsoft.in.cpp index 45e4876998acc5..8d9d6fbe40a8be 100644 --- a/src/frontends/onnx/tests/onnx_import_com_microsoft.in.cpp +++ b/src/frontends/onnx/tests/onnx_import_com_microsoft.in.cpp @@ -33,19 +33,27 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_bias_gelu) { "onnx/com.microsoft/bias_gelu.onnx")); auto test_case = test::TestCase(function, s_device); - test_case.add_input({0.5488135, - 0.71518934, - 0.60276335, - 0.5448832, - 0.4236548, - 0.6458941, - 0.4375872, - 0.891773, - 0.96366274, - 0.3834415}); - test_case.add_input({0.79172504, 0.5288949, 0.56804454, 0.92559665, 0.07103606}); - test_case.add_expected_output( - {1.2198428, 1.1112978, 1.0293297, 1.366493, 0.3411342, 1.329408, 0.8051748, 1.354462, 1.8336612, 0.3068893}); + test_case.add_input({0.5488135f, + 0.71518934f, + 0.60276335f, + 0.5448832f, + 0.4236548f, + 0.6458941f, + 0.4375872f, + 0.891773f, + 0.96366274f, + 0.3834415f}); + test_case.add_input({0.79172504f, 0.5288949f, 0.56804454f, 0.92559665f, 0.07103606f}); + test_case.add_expected_output({1.2198428f, + 1.1112978f, + 1.0293297f, + 1.366493f, + 0.3411342f, + 1.329408f, + 0.8051748f, + 1.354462f, + 1.8336612f, + 0.3068893f}); test_case.run(); } @@ -56,19 +64,19 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_skip_layer_normalization_with_gamma_beta "onnx/com.microsoft/skip_layer_normalization_with_gamma_beta_bias.onnx")); std::vector input = { - 0.54881352, 0.71518934, 0.60276335, 0.54488319, 0.42365479, 0.64589411, 0.43758720, 0.89177299, - 0.96366274, 0.38344151, 0.79172504, 0.52889490, 0.56804454, 0.92559665, 0.07103606, 0.08712930, - 0.02021840, 0.83261985, 0.77815676, 0.87001216, 0.97861832, 0.79915857, 0.46147937, 0.78052920, + 0.54881352f, 0.71518934f, 0.60276335f, 0.54488319f, 0.42365479f, 0.64589411f, 0.43758720f, 0.89177299f, + 0.96366274f, 0.38344151f, 0.79172504f, 0.52889490f, 0.56804454f, 0.92559665f, 0.07103606f, 0.08712930f, + 0.02021840f, 0.83261985f, 0.77815676f, 0.87001216f, 0.97861832f, 0.79915857f, 0.46147937f, 0.78052920f, }; std::vector skip = { - 0.11827443, 0.63992101, 0.14335328, 0.94466889, 0.52184832, 0.41466194, 0.26455560, 0.77423370, - 0.45615032, 0.56843394, 0.01878980, 0.61763549, 0.61209571, 0.61693400, 0.94374806, 0.68182027, - 0.35950789, 0.43703195, 0.69763118, 0.06022547, 0.66676670, 0.67063785, 0.21038257, 0.12892629, + 0.11827443f, 0.63992101f, 0.14335328f, 0.94466889f, 0.52184832f, 0.41466194f, 0.26455560f, 0.77423370f, + 0.45615032f, 0.56843394f, 0.01878980f, 0.61763549f, 0.61209571f, 0.61693400f, 0.94374806f, 0.68182027f, + 0.35950789f, 0.43703195f, 0.69763118f, 0.06022547f, 0.66676670f, 0.67063785f, 0.21038257f, 0.12892629f, }; std::vector expected = { - -0.19721794, -0.42944565, 0.18620640, 0.61282152, -0.11097327, -0.59518522, 0.13393641, 0.66901535, - 0.04256713, -0.71902490, 0.23107991, 0.17300847, -0.04390603, -0.31109563, 0.51021838, -0.66914201, - -0.20009395, -0.43313017, 0.67281967, -0.01712347, 0.09767530, -0.43024653, -0.01836969, -0.29238200, + -0.19721794f, -0.42944565f, 0.18620640f, 0.61282152f, -0.11097327f, -0.59518522f, 0.13393641f, 0.66901535f, + 0.04256713f, -0.71902490f, 0.23107991f, 0.17300847f, -0.04390603f, -0.31109563f, 0.51021838f, -0.66914201f, + -0.20009395f, -0.43313017f, 0.67281967f, -0.01712347f, 0.09767530f, -0.43024653f, -0.01836969f, -0.29238200f, }; auto test_case = test::TestCase(function, s_device); test_case.add_input(input); @@ -84,19 +92,19 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_skip_layer_normalization_with_gamma_beta "onnx/com.microsoft/skip_layer_normalization_with_gamma_beta.onnx")); std::vector input = { - 0.54881352, 0.71518934, 0.60276335, 0.54488319, 0.42365479, 0.64589411, 0.43758720, 0.89177299, - 0.96366274, 0.38344151, 0.79172504, 0.52889490, 0.56804454, 0.92559665, 0.07103606, 0.08712930, - 0.02021840, 0.83261985, 0.77815676, 0.87001216, 0.97861832, 0.79915857, 0.46147937, 0.78052920, + 0.54881352f, 0.71518934f, 0.60276335f, 0.54488319f, 0.42365479f, 0.64589411f, 0.43758720f, 0.89177299f, + 0.96366274f, 0.38344151f, 0.79172504f, 0.52889490f, 0.56804454f, 0.92559665f, 0.07103606f, 0.08712930f, + 0.02021840f, 0.83261985f, 0.77815676f, 0.87001216f, 0.97861832f, 0.79915857f, 0.46147937f, 0.78052920f, }; std::vector skip = { - 0.11827443, 0.63992101, 0.14335328, 0.94466889, 0.52184832, 0.41466194, 0.26455560, 0.77423370, - 0.45615032, 0.56843394, 0.01878980, 0.61763549, 0.61209571, 0.61693400, 0.94374806, 0.68182027, - 0.35950789, 0.43703195, 0.69763118, 0.06022547, 0.66676670, 0.67063785, 0.21038257, 0.12892629, + 0.11827443f, 0.63992101f, 0.14335328f, 0.94466889f, 0.52184832f, 0.41466194f, 0.26455560f, 0.77423370f, + 0.45615032f, 0.56843394f, 0.01878980f, 0.61763549f, 0.61209571f, 0.61693400f, 0.94374806f, 0.68182027f, + 0.35950789f, 0.43703195f, 0.69763118f, 0.06022547f, 0.66676670f, 0.67063785f, 0.21038257f, 0.12892629f, }; std::vector expected = { - -0.17974678, -0.23946194, -0.04376268, 0.46959469, -0.11171167, -0.41859278, -0.11082965, 0.64513868, - 0.07773457, -0.51403606, -0.13661698, 0.11262375, -0.05096011, -0.10416907, 0.10070466, -0.50876135, - -0.22290939, -0.27663514, 0.55416691, -0.08064821, 0.04857478, -0.25121087, -0.15912610, -0.26637587, + -0.17974678f, -0.23946194f, -0.04376268f, 0.46959469f, -0.11171167f, -0.41859278f, -0.11082965f, 0.64513868f, + 0.07773457f, -0.51403606f, -0.13661698f, 0.11262375f, -0.05096011f, -0.10416907f, 0.10070466f, -0.50876135f, + -0.22290939f, -0.27663514f, 0.55416691f, -0.08064821f, 0.04857478f, -0.25121087f, -0.15912610f, -0.26637587f, }; auto test_case = test::TestCase(function, s_device); test_case.add_input(input); @@ -112,19 +120,19 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_skip_layer_normalization_with_gamma) { "onnx/com.microsoft/skip_layer_normalization_with_gamma.onnx")); std::vector input = { - 0.54881352, 0.71518934, 0.60276335, 0.54488319, 0.42365479, 0.64589411, 0.43758720, 0.89177299, - 0.96366274, 0.38344151, 0.79172504, 0.52889490, 0.56804454, 0.92559665, 0.07103606, 0.08712930, - 0.02021840, 0.83261985, 0.77815676, 0.87001216, 0.97861832, 0.79915857, 0.46147937, 0.78052920, + 0.54881352f, 0.71518934f, 0.60276335f, 0.54488319f, 0.42365479f, 0.64589411f, 0.43758720f, 0.89177299f, + 0.96366274f, 0.38344151f, 0.79172504f, 0.52889490f, 0.56804454f, 0.92559665f, 0.07103606f, 0.08712930f, + 0.02021840f, 0.83261985f, 0.77815676f, 0.87001216f, 0.97861832f, 0.79915857f, 0.46147937f, 0.78052920f, }; std::vector skip = { - 0.11827443, 0.63992101, 0.14335328, 0.94466889, 0.52184832, 0.41466194, 0.26455560, 0.77423370, - 0.45615032, 0.56843394, 0.01878980, 0.61763549, 0.61209571, 0.61693400, 0.94374806, 0.68182027, - 0.35950789, 0.43703195, 0.69763118, 0.06022547, 0.66676670, 0.67063785, 0.21038257, 0.12892629, + 0.11827443f, 0.63992101f, 0.14335328f, 0.94466889f, 0.52184832f, 0.41466194f, 0.26455560f, 0.77423370f, + 0.45615032f, 0.56843394f, 0.01878980f, 0.61763549f, 0.61209571f, 0.61693400f, 0.94374806f, 0.68182027f, + 0.35950789f, 0.43703195f, 0.69763118f, 0.06022547f, 0.66676670f, 0.67063785f, 0.21038257f, 0.12892629f, }; std::vector expected = { - -0.10974677, 0.16053806, -0.26376268, 0.46959469, -0.04171166, -0.01859277, -0.33082965, 0.64513868, - 0.14773457, -0.11403608, -0.35661697, 0.11262375, 0.01903989, 0.29583094, -0.11929534, -0.50876135, - -0.15290938, 0.12336487, 0.33416691, -0.08064821, 0.11857478, 0.14878914, -0.37912610, -0.26637587, + -0.10974677f, 0.16053806f, -0.26376268f, 0.46959469f, -0.04171166f, -0.01859277f, -0.33082965f, 0.64513868f, + 0.14773457f, -0.11403608f, -0.35661697f, 0.11262375f, 0.01903989f, 0.29583094f, -0.11929534f, -0.50876135f, + -0.15290938f, 0.12336487f, 0.33416691f, -0.08064821f, 0.11857478f, 0.14878914f, -0.37912610f, -0.26637587f, }; auto test_case = test::TestCase(function, s_device); test_case.add_input(input); @@ -140,37 +148,37 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_skip_layer_normalization_dynamic_shapes) "onnx/com.microsoft/skip_layer_normalization_dynamic_shapes.onnx")); std::vector input = { - 0.54881352, 0.71518934, 0.60276335, 0.54488319, 0.42365479, 0.64589411, 0.43758720, 0.89177299, - 0.96366274, 0.38344151, 0.79172504, 0.52889490, 0.56804454, 0.92559665, 0.07103606, 0.08712930, - 0.02021840, 0.83261985, 0.77815676, 0.87001216, 0.97861832, 0.79915857, 0.46147937, 0.78052920, + 0.54881352f, 0.71518934f, 0.60276335f, 0.54488319f, 0.42365479f, 0.64589411f, 0.43758720f, 0.89177299f, + 0.96366274f, 0.38344151f, 0.79172504f, 0.52889490f, 0.56804454f, 0.92559665f, 0.07103606f, 0.08712930f, + 0.02021840f, 0.83261985f, 0.77815676f, 0.87001216f, 0.97861832f, 0.79915857f, 0.46147937f, 0.78052920f, }; std::vector skip = { - 0.11827443, 0.63992101, 0.14335328, 0.94466889, 0.52184832, 0.41466194, 0.26455560, 0.77423370, - 0.45615032, 0.56843394, 0.01878980, 0.61763549, 0.61209571, 0.61693400, 0.94374806, 0.68182027, - 0.35950789, 0.43703195, 0.69763118, 0.06022547, 0.66676670, 0.67063785, 0.21038257, 0.12892629, + 0.11827443f, 0.63992101f, 0.14335328f, 0.94466889f, 0.52184832f, 0.41466194f, 0.26455560f, 0.77423370f, + 0.45615032f, 0.56843394f, 0.01878980f, 0.61763549f, 0.61209571f, 0.61693400f, 0.94374806f, 0.68182027f, + 0.35950789f, 0.43703195f, 0.69763118f, 0.06022547f, 0.66676670f, 0.67063785f, 0.21038257f, 0.12892629f, }; std::vector gamma = { - 0.31542835, - 0.36371076, - 0.57019675, - 0.43860152, + 0.31542835f, + 0.36371076f, + 0.57019675f, + 0.43860152f, }; std::vector beta = { - 0.98837382, - 0.10204481, - 0.20887676, - 0.16130951, + 0.98837382f, + 0.10204481f, + 0.20887676f, + 0.16130951f, }; std::vector bias = { - 0.65310830, - 0.25329161, - 0.46631077, - 0.24442559, + 0.65310830f, + 0.25329161f, + 0.46631077f, + 0.24442559f, }; std::vector expected = { - 0.76600611, 0.34308332, -0.48470584, 0.71335256, 1.10028172, -0.13354334, -0.45232186, 0.79840088, - 1.52454257, -0.19450217, -0.13759643, 0.03988872, 1.27861762, 0.39529073, 0.12247884, -0.52944231, - 0.64228040, 0.21059875, 1.05966032, -0.14278713, 1.46366918, 0.21215858, -0.31640187, -0.22832340, + 0.76600611f, 0.34308332f, -0.48470584f, 0.71335256f, 1.10028172f, -0.13354334f, -0.45232186f, 0.79840088f, + 1.52454257f, -0.19450217f, -0.13759643f, 0.03988872f, 1.27861762f, 0.39529073f, 0.12247884f, -0.52944231f, + 0.64228040f, 0.21059875f, 1.05966032f, -0.14278713f, 1.46366918f, 0.21215858f, -0.31640187f, -0.22832340f, }; auto test_case = test::TestCase(function, s_device); @@ -193,21 +201,21 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_embed_layer_normalization) { 8, 1, 5, 9, 8, 9, 4, 3, 0, 3, 5, 0, 2, 3, 8, 1, 3, 3, 3, 7, 0, 1, 9, 9, }; std::vector expected_output = { - -0.06615843, -0.18040463, 0.02199928, 0.01868065, 0.05397778, -0.11761580, -0.09138932, -0.02506775, - -0.02368510, -0.10373901, -0.05551499, -0.20972314, 0.01365213, 0.01132561, -0.08603337, -0.08906764, - 0.09692993, -0.04444099, -0.02037602, -0.03453060, -0.10214549, -0.13331436, -0.02665862, -0.01228805, - -0.14232540, -0.07032782, 0.05511986, -0.00120272, -0.04875736, -0.13051267, -0.05709254, 0.17854357, - -0.01759873, -0.01819968, 0.07573269, 0.00557164, 0.06232717, 0.00530490, -0.01565807, -0.14841977, - -0.02299280, 0.02038561, -0.00049481, 0.02575402, 0.10081697, -0.12517214, -0.09316762, -0.00974943, - -0.03093284, -0.06309240, -0.05551499, -0.20972314, 0.01365213, 0.01132561, -0.08603337, -0.06176658, - 0.08304203, -0.05025182, 0.00383657, -0.02288112, -0.11407227, -0.01386134, -0.04411830, -0.00537948, - 0.00164397, -0.03739140, 0.09941526, 0.00333974, -0.04251949, -0.12992151, -0.09509478, -0.11811313, - -0.03307065, -0.00866115, -0.15162414, 0.01106802, 0.06037656, 0.00035292, -0.00223284, -0.11215645, - -0.01390734, 0.07064321, 0.04028325, -0.00290875, 0.12875907, -0.12517214, -0.09316762, -0.00974943, - -0.03093284, -0.06309240, -0.08723789, 0.03130914, 0.03131931, -0.01526242, 0.20811458, -0.05696163, - 0.16304255, -0.02407495, -0.02955675, -0.03086288, -0.08130091, -0.05001551, -0.04875683, 0.00143666, - -0.12153473, -0.00018507, 0.10957482, -0.00416618, -0.01612359, -0.11605026, -0.08593204, 0.09055272, - -0.03054028, -0.03603891, -0.08479506, -0.00034568, 0.03713699, 0.00163411, -0.01738501, -0.18267182, + -0.06615843f, -0.18040463f, 0.02199928f, 0.01868065f, 0.05397778f, -0.11761580f, -0.09138932f, -0.02506775f, + -0.02368510f, -0.10373901f, -0.05551499f, -0.20972314f, 0.01365213f, 0.01132561f, -0.08603337f, -0.08906764f, + 0.09692993f, -0.04444099f, -0.02037602f, -0.03453060f, -0.10214549f, -0.13331436f, -0.02665862f, -0.01228805f, + -0.14232540f, -0.07032782f, 0.05511986f, -0.00120272f, -0.04875736f, -0.13051267f, -0.05709254f, 0.17854357f, + -0.01759873f, -0.01819968f, 0.07573269f, 0.00557164f, 0.06232717f, 0.00530490f, -0.01565807f, -0.14841977f, + -0.02299280f, 0.02038561f, -0.00049481f, 0.02575402f, 0.10081697f, -0.12517214f, -0.09316762f, -0.00974943f, + -0.03093284f, -0.06309240f, -0.05551499f, -0.20972314f, 0.01365213f, 0.01132561f, -0.08603337f, -0.06176658f, + 0.08304203f, -0.05025182f, 0.00383657f, -0.02288112f, -0.11407227f, -0.01386134f, -0.04411830f, -0.00537948f, + 0.00164397f, -0.03739140f, 0.09941526f, 0.00333974f, -0.04251949f, -0.12992151f, -0.09509478f, -0.11811313f, + -0.03307065f, -0.00866115f, -0.15162414f, 0.01106802f, 0.06037656f, 0.00035292f, -0.00223284f, -0.11215645f, + -0.01390734f, 0.07064321f, 0.04028325f, -0.00290875f, 0.12875907f, -0.12517214f, -0.09316762f, -0.00974943f, + -0.03093284f, -0.06309240f, -0.08723789f, 0.03130914f, 0.03131931f, -0.01526242f, 0.20811458f, -0.05696163f, + 0.16304255f, -0.02407495f, -0.02955675f, -0.03086288f, -0.08130091f, -0.05001551f, -0.04875683f, 0.00143666f, + -0.12153473f, -0.00018507f, 0.10957482f, -0.00416618f, -0.01612359f, -0.11605026f, -0.08593204f, 0.09055272f, + -0.03054028f, -0.03603891f, -0.08479506f, -0.00034568f, 0.03713699f, 0.00163411f, -0.01738501f, -0.18267182f, }; auto test_case = test::TestCase(function, s_device); @@ -229,21 +237,21 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_embed_layer_normalization_with_segment_e 0, 2, 0, 2, 2, 0, 2, 0, 0, 0, 1, 1, 2, 0, 0, 1, 0, 1, 2, 2, 0, 1, 1, 1, }; std::vector expected_output = { - -0.06044213, -0.14845914, 0.02457689, 0.02091519, 0.09514004, -0.10280035, -0.02087995, -0.03323204, - -0.02967127, -0.13447416, -0.05191760, -0.16518904, 0.02340531, 0.02176395, 0.04972410, -0.07360736, - 0.12192874, -0.04081530, -0.02338044, -0.05671440, -0.09475864, -0.08944942, -0.03362993, -0.01683486, - -0.16770349, -0.07382569, 0.06230322, 0.02215859, -0.05212611, -0.03934773, -0.04748865, 0.18134241, - -0.01965741, -0.02202452, 0.01973994, 0.01575558, 0.04300199, 0.01436110, -0.00198062, -0.09065692, - -0.02923042, -0.00748686, 0.00717049, 0.02638642, 0.12174864, -0.12973398, -0.11872391, -0.00549398, - -0.02386289, -0.02210563, -0.03590920, -0.13728066, -0.01337939, 0.01538021, -0.14687485, -0.05033565, - 0.03818212, -0.04939338, 0.00961064, -0.07407621, -0.09624685, 0.05594898, -0.04948713, -0.01305631, - -0.03779668, -0.01469170, 0.12346989, 0.02082030, -0.03449103, -0.06029151, -0.09300473, -0.16308543, - -0.02370042, 0.01066893, -0.06523034, 0.00497636, 0.01933458, -0.00900802, 0.00430878, -0.13999483, - -0.02377289, 0.01760014, 0.03896973, 0.00831112, 0.15634246, -0.11109130, -0.11997811, -0.02304414, - -0.01989413, -0.12763791, -0.05698400, 0.17125534, 0.00499324, -0.02953288, 0.09178342, -0.05001877, - 0.16157132, -0.02312993, -0.02932195, -0.04914058, -0.07994118, -0.07199102, -0.04517454, 0.01249476, - -0.07525793, -0.00207180, 0.03993115, -0.01676321, -0.00214832, -0.16074482, -0.05012497, -0.00552153, - -0.04302063, -0.00549224, -0.18399858, -0.00767871, -0.02209404, -0.01383207, -0.00082931, -0.19533031, + -0.06044213f, -0.14845914f, 0.02457689f, 0.02091519f, 0.09514004f, -0.10280035f, -0.02087995f, -0.03323204f, + -0.02967127f, -0.13447416f, -0.05191760f, -0.16518904f, 0.02340531f, 0.02176395f, 0.04972410f, -0.07360736f, + 0.12192874f, -0.04081530f, -0.02338044f, -0.05671440f, -0.09475864f, -0.08944942f, -0.03362993f, -0.01683486f, + -0.16770349f, -0.07382569f, 0.06230322f, 0.02215859f, -0.05212611f, -0.03934773f, -0.04748865f, 0.18134241f, + -0.01965741f, -0.02202452f, 0.01973994f, 0.01575558f, 0.04300199f, 0.01436110f, -0.00198062f, -0.09065692f, + -0.02923042f, -0.00748686f, 0.00717049f, 0.02638642f, 0.12174864f, -0.12973398f, -0.11872391f, -0.00549398f, + -0.02386289f, -0.02210563f, -0.03590920f, -0.13728066f, -0.01337939f, 0.01538021f, -0.14687485f, -0.05033565f, + 0.03818212f, -0.04939338f, 0.00961064f, -0.07407621f, -0.09624685f, 0.05594898f, -0.04948713f, -0.01305631f, + -0.03779668f, -0.01469170f, 0.12346989f, 0.02082030f, -0.03449103f, -0.06029151f, -0.09300473f, -0.16308543f, + -0.02370042f, 0.01066893f, -0.06523034f, 0.00497636f, 0.01933458f, -0.00900802f, 0.00430878f, -0.13999483f, + -0.02377289f, 0.01760014f, 0.03896973f, 0.00831112f, 0.15634246f, -0.11109130f, -0.11997811f, -0.02304414f, + -0.01989413f, -0.12763791f, -0.05698400f, 0.17125534f, 0.00499324f, -0.02953288f, 0.09178342f, -0.05001877f, + 0.16157132f, -0.02312993f, -0.02932195f, -0.04914058f, -0.07994118f, -0.07199102f, -0.04517454f, 0.01249476f, + -0.07525793f, -0.00207180f, 0.03993115f, -0.01676321f, -0.00214832f, -0.16074482f, -0.05012497f, -0.00552153f, + -0.04302063f, -0.00549224f, -0.18399858f, -0.00767871f, -0.02209404f, -0.01383207f, -0.00082931f, -0.19533031f, }; std::vector expected_mask_index = { @@ -276,21 +284,21 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_embed_layer_normalization_with_segment_e 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, }; std::vector expected_output = { - -0.06044213, -0.14845914, 0.02457689, 0.02091519, 0.09514004, -0.10280035, -0.02087995, -0.03323204, - -0.02967127, -0.13447416, -0.05191760, -0.16518904, 0.02340531, 0.02176395, 0.04972410, -0.07360736, - 0.12192874, -0.04081530, -0.02338044, -0.05671440, -0.09475864, -0.08944942, -0.03362993, -0.01683486, - -0.16770349, -0.07382569, 0.06230322, 0.02215859, -0.05212611, -0.03934773, -0.04748865, 0.18134241, - -0.01965741, -0.02202452, 0.01973994, 0.01575558, 0.04300199, 0.01436110, -0.00198062, -0.09065692, - -0.02923042, -0.00748686, 0.00717049, 0.02638642, 0.12174864, -0.12973398, -0.11872391, -0.00549398, - -0.02386289, -0.02210563, -0.03590920, -0.13728066, -0.01337939, 0.01538021, -0.14687485, -0.05033565, - 0.03818212, -0.04939338, 0.00961064, -0.07407621, -0.09624685, 0.05594898, -0.04948713, -0.01305631, - -0.03779668, -0.01469170, 0.12346989, 0.02082030, -0.03449103, -0.06029151, -0.09300473, -0.16308543, - -0.02370042, 0.01066893, -0.06523034, 0.00497636, 0.01933458, -0.00900802, 0.00430878, -0.13999483, - -0.02377289, 0.01760014, 0.03896973, 0.00831112, 0.15634246, -0.11109130, -0.11997811, -0.02304414, - -0.01989413, -0.12763791, -0.05698400, 0.17125534, 0.00499324, -0.02953288, 0.09178342, -0.05001877, - 0.16157132, -0.02312993, -0.02932195, -0.04914058, -0.07994118, -0.07199102, -0.04517454, 0.01249476, - -0.07525793, -0.00207180, 0.03993115, -0.01676321, -0.00214832, -0.16074482, -0.05012497, -0.00552153, - -0.04302063, -0.00549224, -0.18399858, -0.00767871, -0.02209404, -0.01383207, -0.00082931, -0.19533031, + -0.06044213f, -0.14845914f, 0.02457689f, 0.02091519f, 0.09514004f, -0.10280035f, -0.02087995f, -0.03323204f, + -0.02967127f, -0.13447416f, -0.05191760f, -0.16518904f, 0.02340531f, 0.02176395f, 0.04972410f, -0.07360736f, + 0.12192874f, -0.04081530f, -0.02338044f, -0.05671440f, -0.09475864f, -0.08944942f, -0.03362993f, -0.01683486f, + -0.16770349f, -0.07382569f, 0.06230322f, 0.02215859f, -0.05212611f, -0.03934773f, -0.04748865f, 0.18134241f, + -0.01965741f, -0.02202452f, 0.01973994f, 0.01575558f, 0.04300199f, 0.01436110f, -0.00198062f, -0.09065692f, + -0.02923042f, -0.00748686f, 0.00717049f, 0.02638642f, 0.12174864f, -0.12973398f, -0.11872391f, -0.00549398f, + -0.02386289f, -0.02210563f, -0.03590920f, -0.13728066f, -0.01337939f, 0.01538021f, -0.14687485f, -0.05033565f, + 0.03818212f, -0.04939338f, 0.00961064f, -0.07407621f, -0.09624685f, 0.05594898f, -0.04948713f, -0.01305631f, + -0.03779668f, -0.01469170f, 0.12346989f, 0.02082030f, -0.03449103f, -0.06029151f, -0.09300473f, -0.16308543f, + -0.02370042f, 0.01066893f, -0.06523034f, 0.00497636f, 0.01933458f, -0.00900802f, 0.00430878f, -0.13999483f, + -0.02377289f, 0.01760014f, 0.03896973f, 0.00831112f, 0.15634246f, -0.11109130f, -0.11997811f, -0.02304414f, + -0.01989413f, -0.12763791f, -0.05698400f, 0.17125534f, 0.00499324f, -0.02953288f, 0.09178342f, -0.05001877f, + 0.16157132f, -0.02312993f, -0.02932195f, -0.04914058f, -0.07994118f, -0.07199102f, -0.04517454f, 0.01249476f, + -0.07525793f, -0.00207180f, 0.03993115f, -0.01676321f, -0.00214832f, -0.16074482f, -0.05012497f, -0.00552153f, + -0.04302063f, -0.00549224f, -0.18399858f, -0.00767871f, -0.02209404f, -0.01383207f, -0.00082931f, -0.19533031f, }; std::vector expected_mask_index = { 5, @@ -320,70 +328,71 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_embed_layer_normalization_dynamic_shapes 0, 2, 0, 2, 2, 0, 2, 0, 0, 0, 1, 1, 2, 0, 0, 1, 0, 1, 2, 2, 0, 1, 1, 1, }; std::vector word_embeddings = { - 0.96980906, 0.65314001, 0.17090958, 0.35815218, 0.75068617, 0.60783064, 0.32504722, 0.03842543, 0.63427407, - 0.95894927, 0.65279031, 0.63505888, 0.99529958, 0.58185035, 0.41436860, 0.47469750, 0.62351012, 0.33800763, - 0.67475230, 0.31720173, 0.77834547, 0.94957107, 0.66252685, 0.01357164, 0.62284607, 0.67365962, 0.97194499, - 0.87819350, 0.50962436, 0.05571469, 0.45115921, 0.01998767, 0.44171092, 0.97958672, 0.35944447, 0.48089352, - 0.68866116, 0.88047588, 0.91823548, 0.21682213, 0.56518888, 0.86510259, 0.50896895, 0.91672295, 0.92115760, - 0.08311249, 0.27771857, 0.00935670, 0.84234208, 0.64717412, + 0.96980906f, 0.65314001f, 0.17090958f, 0.35815218f, 0.75068617f, 0.60783064f, 0.32504722f, 0.03842543f, + 0.63427407f, 0.95894927f, 0.65279031f, 0.63505888f, 0.99529958f, 0.58185035f, 0.41436860f, 0.47469750f, + 0.62351012f, 0.33800763f, 0.67475230f, 0.31720173f, 0.77834547f, 0.94957107f, 0.66252685f, 0.01357164f, + 0.62284607f, 0.67365962f, 0.97194499f, 0.87819350f, 0.50962436f, 0.05571469f, 0.45115921f, 0.01998767f, + 0.44171092f, 0.97958672f, 0.35944447f, 0.48089352f, 0.68866116f, 0.88047588f, 0.91823548f, 0.21682213f, + 0.56518888f, 0.86510259f, 0.50896895f, 0.91672295f, 0.92115760f, 0.08311249f, 0.27771857f, 0.00935670f, + 0.84234208f, 0.64717412f, }; std::vector position_embeddings = { - 0.84138614, 0.26473016, 0.39782074, 0.55282146, 0.16494046, 0.36980811, 0.14644176, 0.56961840, - 0.70373726, 0.28847644, 0.43328807, 0.75610667, 0.39609829, 0.89603841, 0.63892108, 0.89155442, - 0.68005556, 0.44919774, 0.97857094, 0.11620191, 0.76702368, 0.41182014, 0.67543906, 0.24979627, - 0.31321833, 0.96541619, 0.58846509, 0.65966839, 0.53320622, 0.23053302, 0.39486930, 0.61880857, - 0.47486752, 0.47013220, 0.71607453, 0.28799102, 0.38346222, 0.74916983, 0.87845218, 0.10286336, + 0.84138614f, 0.26473016f, 0.39782074f, 0.55282146f, 0.16494046f, 0.36980811f, 0.14644176f, 0.56961840f, + 0.70373726f, 0.28847644f, 0.43328807f, 0.75610667f, 0.39609829f, 0.89603841f, 0.63892108f, 0.89155442f, + 0.68005556f, 0.44919774f, 0.97857094f, 0.11620191f, 0.76702368f, 0.41182014f, 0.67543906f, 0.24979627f, + 0.31321833f, 0.96541619f, 0.58846509f, 0.65966839f, 0.53320622f, 0.23053302f, 0.39486930f, 0.61880857f, + 0.47486752f, 0.47013220f, 0.71607453f, 0.28799102f, 0.38346222f, 0.74916983f, 0.87845218f, 0.10286336f, }; std::vector segment_embeddings = { - 0.09237389, - 0.35404667, - 0.55181628, - 0.03362509, - 0.96896178, - 0.32099724, - 0.22126268, - 0.14126390, - 0.09725992, - 0.98404223, - 0.26034093, - 0.53702253, - 0.44792616, - 0.09956909, - 0.35231167, + 0.09237389f, + 0.35404667f, + 0.55181628f, + 0.03362509f, + 0.96896178f, + 0.32099724f, + 0.22126268f, + 0.14126390f, + 0.09725992f, + 0.98404223f, + 0.26034093f, + 0.53702253f, + 0.44792616f, + 0.09956909f, + 0.35231167f, }; std::vector gamma = { - 0.46924916, - 0.84114015, - 0.90464777, - 0.03755938, - 0.50831544, + 0.46924916f, + 0.84114015f, + 0.90464777f, + 0.03755938f, + 0.50831544f, }; std::vector beta = { - 0.16684751, - 0.77905101, - 0.86493331, - 0.41139671, - 0.13997258, + 0.16684751f, + 0.77905101f, + 0.86493331f, + 0.41139671f, + 0.13997258f, }; std::vector mask = { 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, }; std::vector expected_output = { - -0.04089922, 0.35108989, 0.30442458, 0.39546335, 1.15422225, 0.10419128, -0.19301927, 0.01070970, - 0.43977541, 0.89119899, -0.51436460, 1.99256825, 1.41077507, 0.38642293, 0.17583044, 0.03320138, - 1.16508031, -0.24356931, 0.47440714, -0.17844005, 0.20463173, 1.90038323, 1.14138567, 0.34504607, - 0.16403235, -0.24976699, 0.29362509, 0.34502214, 0.41751838, 1.09390712, 0.12354189, 1.83025289, - 1.05569196, 0.34413773, 0.35469764, -0.69760042, 0.76338542, 1.75443077, 0.44126555, 0.18181801, - 0.73277575, 0.45443264, 0.17068321, 0.36591727, 0.72869974, -0.56090516, 0.14415455, 1.47314119, - 0.42908576, 0.73084539, -0.22373237, 2.26550221, 0.05606699, 0.39417523, 0.35234636, 0.78569502, - 0.77521765, -0.65131050, 0.40168875, 0.45527256, 0.38715565, 0.98521245, 2.21446753, 0.36345237, - -0.33269632, 0.36558092, 1.36846578, 1.37523413, 0.33698002, 0.28889543, -0.40639281, 1.01643157, - 0.59668219, 0.39197800, 1.03101778, 0.02551098, -0.03612846, -0.01371557, 0.43444607, 0.96746695, - 0.60583955, -0.10362893, 0.40574494, 0.38046724, 0.87445319, -0.00880148, -0.15437943, 0.08118075, - 0.44650543, 0.85956848, -0.27865338, 2.10837507, 0.04798460, 0.43948367, -0.10185169, 0.19978794, - 1.32323360, 1.20525467, 0.44288942, -0.84200430, 0.52563053, 0.69949460, 0.73987913, 0.34668452, - 0.74545687, 0.57696682, 0.22452033, -0.27099937, 0.39649010, 0.87083614, -0.18965788, 0.58206403, - -0.08108193, 0.42067638, 1.05117214, -0.34287399, 0.20424896, 0.27994895, 0.46011117, 0.70890665, + -0.04089922f, 0.35108989f, 0.30442458f, 0.39546335f, 1.15422225f, 0.10419128f, -0.19301927f, 0.01070970f, + 0.43977541f, 0.89119899f, -0.51436460f, 1.99256825f, 1.41077507f, 0.38642293f, 0.17583044f, 0.03320138f, + 1.16508031f, -0.24356931f, 0.47440714f, -0.17844005f, 0.20463173f, 1.90038323f, 1.14138567f, 0.34504607f, + 0.16403235f, -0.24976699f, 0.29362509f, 0.34502214f, 0.41751838f, 1.09390712f, 0.12354189f, 1.83025289f, + 1.05569196f, 0.34413773f, 0.35469764f, -0.69760042f, 0.76338542f, 1.75443077f, 0.44126555f, 0.18181801f, + 0.73277575f, 0.45443264f, 0.17068321f, 0.36591727f, 0.72869974f, -0.56090516f, 0.14415455f, 1.47314119f, + 0.42908576f, 0.73084539f, -0.22373237f, 2.26550221f, 0.05606699f, 0.39417523f, 0.35234636f, 0.78569502f, + 0.77521765f, -0.65131050f, 0.40168875f, 0.45527256f, 0.38715565f, 0.98521245f, 2.21446753f, 0.36345237f, + -0.33269632f, 0.36558092f, 1.36846578f, 1.37523413f, 0.33698002f, 0.28889543f, -0.40639281f, 1.01643157f, + 0.59668219f, 0.39197800f, 1.03101778f, 0.02551098f, -0.03612846f, -0.01371557f, 0.43444607f, 0.96746695f, + 0.60583955f, -0.10362893f, 0.40574494f, 0.38046724f, 0.87445319f, -0.00880148f, -0.15437943f, 0.08118075f, + 0.44650543f, 0.85956848f, -0.27865338f, 2.10837507f, 0.04798460f, 0.43948367f, -0.10185169f, 0.19978794f, + 1.32323360f, 1.20525467f, 0.44288942f, -0.84200430f, 0.52563053f, 0.69949460f, 0.73987913f, 0.34668452f, + 0.74545687f, 0.57696682f, 0.22452033f, -0.27099937f, 0.39649010f, 0.87083614f, -0.18965788f, 0.58206403f, + -0.08108193f, 0.42067638f, 1.05117214f, -0.34287399f, 0.20424896f, 0.27994895f, 0.46011117f, 0.70890665f, }; std::vector expected_mask_index = { 6, @@ -418,70 +427,72 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_embed_layer_normalization_diff_seq_len_p 0, 2, 0, 2, 2, 0, 2, 0, 0, 0, 1, 1, 2, 0, 0, 1, 0, 1, 2, 2, 0, 1, 1, 1, }; std::vector word_embeddings = { - 0.96980906, 0.65314001, 0.17090958, 0.35815218, 0.75068617, 0.60783064, 0.32504722, 0.03842543, 0.63427407, - 0.95894927, 0.65279031, 0.63505888, 0.99529958, 0.58185035, 0.41436860, 0.47469750, 0.62351012, 0.33800763, - 0.67475230, 0.31720173, 0.77834547, 0.94957107, 0.66252685, 0.01357164, 0.62284607, 0.67365962, 0.97194499, - 0.87819350, 0.50962436, 0.05571469, 0.45115921, 0.01998767, 0.44171092, 0.97958672, 0.35944447, 0.48089352, - 0.68866116, 0.88047588, 0.91823548, 0.21682213, 0.56518888, 0.86510259, 0.50896895, 0.91672295, 0.92115760, - 0.08311249, 0.27771857, 0.00935670, 0.84234208, 0.64717412, + 0.96980906f, 0.65314001f, 0.17090958f, 0.35815218f, 0.75068617f, 0.60783064f, 0.32504722f, 0.03842543f, + 0.63427407f, 0.95894927f, 0.65279031f, 0.63505888f, 0.99529958f, 0.58185035f, 0.41436860f, 0.47469750f, + 0.62351012f, 0.33800763f, 0.67475230f, 0.31720173f, 0.77834547f, 0.94957107f, 0.66252685f, 0.01357164f, + 0.62284607f, 0.67365962f, 0.97194499f, 0.87819350f, 0.50962436f, 0.05571469f, 0.45115921f, 0.01998767f, + 0.44171092f, 0.97958672f, 0.35944447f, 0.48089352f, 0.68866116f, 0.88047588f, 0.91823548f, 0.21682213f, + 0.56518888f, 0.86510259f, 0.50896895f, 0.91672295f, 0.92115760f, 0.08311249f, 0.27771857f, 0.00935670f, + 0.84234208f, 0.64717412f, }; std::vector position_embeddings = { - 0.84138614, 0.26473016, 0.39782074, 0.55282146, 0.16494046, 0.36980811, 0.14644176, 0.56961840, 0.70373726, - 0.28847644, 0.43328807, 0.75610667, 0.39609829, 0.89603841, 0.63892108, 0.89155442, 0.68005556, 0.44919774, - 0.97857094, 0.11620191, 0.76702368, 0.41182014, 0.67543906, 0.24979627, 0.31321833, 0.96541619, 0.58846509, - 0.65966839, 0.53320622, 0.23053302, 0.39486930, 0.61880857, 0.47486752, 0.47013220, 0.71607453, 0.28799102, - 0.38346222, 0.74916983, 0.87845218, 0.10286336, 0.84138614, 0.26473016, 0.39782074, 0.55282146, 0.16494046, + 0.84138614f, 0.26473016f, 0.39782074f, 0.55282146f, 0.16494046f, 0.36980811f, 0.14644176f, 0.56961840f, + 0.70373726f, 0.28847644f, 0.43328807f, 0.75610667f, 0.39609829f, 0.89603841f, 0.63892108f, 0.89155442f, + 0.68005556f, 0.44919774f, 0.97857094f, 0.11620191f, 0.76702368f, 0.41182014f, 0.67543906f, 0.24979627f, + 0.31321833f, 0.96541619f, 0.58846509f, 0.65966839f, 0.53320622f, 0.23053302f, 0.39486930f, 0.61880857f, + 0.47486752f, 0.47013220f, 0.71607453f, 0.28799102f, 0.38346222f, 0.74916983f, 0.87845218f, 0.10286336f, + 0.84138614f, 0.26473016f, 0.39782074f, 0.55282146f, 0.16494046f, }; std::vector segment_embeddings = { - 0.09237389, - 0.35404667, - 0.55181628, - 0.03362509, - 0.96896178, - 0.32099724, - 0.22126268, - 0.14126390, - 0.09725992, - 0.98404223, - 0.26034093, - 0.53702253, - 0.44792616, - 0.09956909, - 0.35231167, + 0.09237389f, + 0.35404667f, + 0.55181628f, + 0.03362509f, + 0.96896178f, + 0.32099724f, + 0.22126268f, + 0.14126390f, + 0.09725992f, + 0.98404223f, + 0.26034093f, + 0.53702253f, + 0.44792616f, + 0.09956909f, + 0.35231167f, }; std::vector gamma = { - 0.46924916, - 0.84114015, - 0.90464777, - 0.03755938, - 0.50831544, + 0.46924916f, + 0.84114015f, + 0.90464777f, + 0.03755938f, + 0.50831544f, }; std::vector beta = { - 0.16684751, - 0.77905101, - 0.86493331, - 0.41139671, - 0.13997258, + 0.16684751f, + 0.77905101f, + 0.86493331f, + 0.41139671f, + 0.13997258f, }; std::vector mask = { 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, }; std::vector expected_output = { - -0.04089922, 0.35108989, 0.30442458, 0.39546335, 1.15422225, 0.10419128, -0.19301927, 0.01070970, - 0.43977541, 0.89119899, -0.51436460, 1.99256825, 1.41077507, 0.38642293, 0.17583044, 0.03320138, - 1.16508031, -0.24356931, 0.47440714, -0.17844005, 0.20463173, 1.90038323, 1.14138567, 0.34504607, - 0.16403235, -0.24976699, 0.29362509, 0.34502214, 0.41751838, 1.09390712, 0.12354189, 1.83025289, - 1.05569196, 0.34413773, 0.35469764, -0.69760042, 0.76338542, 1.75443077, 0.44126555, 0.18181801, - 0.73277575, 0.45443264, 0.17068321, 0.36591727, 0.72869974, -0.56090516, 0.14415455, 1.47314119, - 0.42908576, 0.73084539, -0.22373237, 2.26550221, 0.05606699, 0.39417523, 0.35234636, 0.78569502, - 0.77521765, -0.65131050, 0.40168875, 0.45527256, 0.38715565, 0.98521245, 2.21446753, 0.36345237, - -0.33269632, 0.36558092, 1.36846578, 1.37523413, 0.33698002, 0.28889543, -0.40639281, 1.01643157, - 0.59668219, 0.39197800, 1.03101778, 0.02551098, -0.03612846, -0.01371557, 0.43444607, 0.96746695, - 0.60583955, -0.10362893, 0.40574494, 0.38046724, 0.87445319, -0.00880148, -0.15437943, 0.08118075, - 0.44650543, 0.85956848, -0.27865338, 2.10837507, 0.04798460, 0.43948367, -0.10185169, 0.19978794, - 1.32323360, 1.20525467, 0.44288942, -0.84200430, 0.52563053, 0.69949460, 0.73987913, 0.34668452, - 0.74545687, 0.57696682, 0.22452033, -0.27099937, 0.39649010, 0.87083614, -0.18965788, 0.58206403, - -0.08108193, 0.42067638, 1.05117214, -0.34287399, 0.20424896, 0.27994895, 0.46011117, 0.70890665, + -0.04089922f, 0.35108989f, 0.30442458f, 0.39546335f, 1.15422225f, 0.10419128f, -0.19301927f, 0.01070970f, + 0.43977541f, 0.89119899f, -0.51436460f, 1.99256825f, 1.41077507f, 0.38642293f, 0.17583044f, 0.03320138f, + 1.16508031f, -0.24356931f, 0.47440714f, -0.17844005f, 0.20463173f, 1.90038323f, 1.14138567f, 0.34504607f, + 0.16403235f, -0.24976699f, 0.29362509f, 0.34502214f, 0.41751838f, 1.09390712f, 0.12354189f, 1.83025289f, + 1.05569196f, 0.34413773f, 0.35469764f, -0.69760042f, 0.76338542f, 1.75443077f, 0.44126555f, 0.18181801f, + 0.73277575f, 0.45443264f, 0.17068321f, 0.36591727f, 0.72869974f, -0.56090516f, 0.14415455f, 1.47314119f, + 0.42908576f, 0.73084539f, -0.22373237f, 2.26550221f, 0.05606699f, 0.39417523f, 0.35234636f, 0.78569502f, + 0.77521765f, -0.65131050f, 0.40168875f, 0.45527256f, 0.38715565f, 0.98521245f, 2.21446753f, 0.36345237f, + -0.33269632f, 0.36558092f, 1.36846578f, 1.37523413f, 0.33698002f, 0.28889543f, -0.40639281f, 1.01643157f, + 0.59668219f, 0.39197800f, 1.03101778f, 0.02551098f, -0.03612846f, -0.01371557f, 0.43444607f, 0.96746695f, + 0.60583955f, -0.10362893f, 0.40574494f, 0.38046724f, 0.87445319f, -0.00880148f, -0.15437943f, 0.08118075f, + 0.44650543f, 0.85956848f, -0.27865338f, 2.10837507f, 0.04798460f, 0.43948367f, -0.10185169f, 0.19978794f, + 1.32323360f, 1.20525467f, 0.44288942f, -0.84200430f, 0.52563053f, 0.69949460f, 0.73987913f, 0.34668452f, + 0.74545687f, 0.57696682f, 0.22452033f, -0.27099937f, 0.39649010f, 0.87083614f, -0.18965788f, 0.58206403f, + -0.08108193f, 0.42067638f, 1.05117214f, -0.34287399f, 0.20424896f, 0.27994895f, 0.46011117f, 0.70890665f, }; std::vector expected_mask_index = { 6, @@ -516,50 +527,52 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_embed_layer_normalization_with_position_ 0, 2, 0, 2, 2, 0, 2, 0, 0, 0, 1, 1, 2, 0, 0, 1, 0, 1, 2, 2, 0, 1, 1, 1, }; std::vector word_embeddings = { - 0.96980906, 0.65314001, 0.17090958, 0.35815218, 0.75068617, 0.60783064, 0.32504722, 0.03842543, 0.63427407, - 0.95894927, 0.65279031, 0.63505888, 0.99529958, 0.58185035, 0.41436860, 0.47469750, 0.62351012, 0.33800763, - 0.67475230, 0.31720173, 0.77834547, 0.94957107, 0.66252685, 0.01357164, 0.62284607, 0.67365962, 0.97194499, - 0.87819350, 0.50962436, 0.05571469, 0.45115921, 0.01998767, 0.44171092, 0.97958672, 0.35944447, 0.48089352, - 0.68866116, 0.88047588, 0.91823548, 0.21682213, 0.56518888, 0.86510259, 0.50896895, 0.91672295, 0.92115760, - 0.08311249, 0.27771857, 0.00935670, 0.84234208, 0.64717412, + 0.96980906f, 0.65314001f, 0.17090958f, 0.35815218f, 0.75068617f, 0.60783064f, 0.32504722f, 0.03842543f, + 0.63427407f, 0.95894927f, 0.65279031f, 0.63505888f, 0.99529958f, 0.58185035f, 0.41436860f, 0.47469750f, + 0.62351012f, 0.33800763f, 0.67475230f, 0.31720173f, 0.77834547f, 0.94957107f, 0.66252685f, 0.01357164f, + 0.62284607f, 0.67365962f, 0.97194499f, 0.87819350f, 0.50962436f, 0.05571469f, 0.45115921f, 0.01998767f, + 0.44171092f, 0.97958672f, 0.35944447f, 0.48089352f, 0.68866116f, 0.88047588f, 0.91823548f, 0.21682213f, + 0.56518888f, 0.86510259f, 0.50896895f, 0.91672295f, 0.92115760f, 0.08311249f, 0.27771857f, 0.00935670f, + 0.84234208f, 0.64717412f, }; std::vector position_embeddings = { - 0.84138614, 0.26473016, 0.39782074, 0.55282146, 0.16494046, 0.43328807, 0.75610667, 0.39609829, 0.89603841, - 0.63892108, 0.36980811, 0.14644176, 0.56961840, 0.70373726, 0.28847644, 0.89155442, 0.68005556, 0.44919774, - 0.97857094, 0.11620191, 0.76702368, 0.41182014, 0.67543906, 0.24979627, 0.31321833, 0.28799102, 0.38346222, - 0.74916983, 0.87845218, 0.10286336, 0.96541619, 0.58846509, 0.65966839, 0.53320622, 0.23053302, 0.39486930, - 0.61880857, 0.47486752, 0.47013220, 0.71607453, 0.84138614, 0.26473016, 0.39782074, 0.55282146, 0.16494046, + 0.84138614f, 0.26473016f, 0.39782074f, 0.55282146f, 0.16494046f, 0.43328807f, 0.75610667f, 0.39609829f, + 0.89603841f, 0.63892108f, 0.36980811f, 0.14644176f, 0.56961840f, 0.70373726f, 0.28847644f, 0.89155442f, + 0.68005556f, 0.44919774f, 0.97857094f, 0.11620191f, 0.76702368f, 0.41182014f, 0.67543906f, 0.24979627f, + 0.31321833f, 0.28799102f, 0.38346222f, 0.74916983f, 0.87845218f, 0.10286336f, 0.96541619f, 0.58846509f, + 0.65966839f, 0.53320622f, 0.23053302f, 0.39486930f, 0.61880857f, 0.47486752f, 0.47013220f, 0.71607453f, + 0.84138614f, 0.26473016f, 0.39782074f, 0.55282146f, 0.16494046f, }; std::vector segment_embeddings = { - 0.09237389, - 0.35404667, - 0.55181628, - 0.03362509, - 0.96896178, - 0.32099724, - 0.22126268, - 0.14126390, - 0.09725992, - 0.98404223, - 0.26034093, - 0.53702253, - 0.44792616, - 0.09956909, - 0.35231167, + 0.09237389f, + 0.35404667f, + 0.55181628f, + 0.03362509f, + 0.96896178f, + 0.32099724f, + 0.22126268f, + 0.14126390f, + 0.09725992f, + 0.98404223f, + 0.26034093f, + 0.53702253f, + 0.44792616f, + 0.09956909f, + 0.35231167f, }; std::vector gamma = { - 0.46924916, - 0.84114015, - 0.90464777, - 0.03755938, - 0.50831544, + 0.46924916f, + 0.84114015f, + 0.90464777f, + 0.03755938f, + 0.50831544f, }; std::vector beta = { - 0.16684751, - 0.77905101, - 0.86493331, - 0.41139671, - 0.13997258, + 0.16684751f, + 0.77905101f, + 0.86493331f, + 0.41139671f, + 0.13997258f, }; std::vector mask = { 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, @@ -568,21 +581,21 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_embed_layer_normalization_with_position_ 0, 2, 1, 3, 4, 6, 7, 5, 8, 2, 1, 3, 4, 6, 7, 5, 0, 2, 1, 3, 4, 6, 7, 5, }; std::vector expected_output = { - -0.04089922, 0.35108989, 0.30442458, 0.39546335, 1.15422225, 0.10419128, -0.19301927, 0.01070970, - 0.43977541, 0.89119899, -0.51436460, 1.99256825, 1.41077507, 0.38642293, 0.17583044, 0.03320138, - 1.16508031, -0.24356931, 0.47440714, -0.17844005, 0.20463173, 1.90038323, 1.14138567, 0.34504607, - 0.16403235, -0.24976699, 0.29362509, 0.34502214, 0.41751838, 1.09390712, 0.12354189, 1.83025289, - 1.05569196, 0.34413773, 0.35469764, -0.69760042, 0.76338542, 1.75443077, 0.44126555, 0.18181801, - 0.73277575, 0.45443264, 0.17068321, 0.36591727, 0.72869974, -0.56090516, 0.14415455, 1.47314119, - 0.42908576, 0.73084539, -0.22373237, 2.26550221, 0.05606699, 0.39417523, 0.35234636, 0.78569502, - 0.77521765, -0.65131050, 0.40168875, 0.45527256, 0.38715565, 0.98521245, 2.21446753, 0.36345237, - -0.33269632, 0.36558092, 1.36846578, 1.37523413, 0.33698002, 0.28889543, -0.40639281, 1.01643157, - 0.59668219, 0.39197800, 1.03101778, 0.02551098, -0.03612846, -0.01371557, 0.43444607, 0.96746695, - 0.60583955, -0.10362893, 0.40574494, 0.38046724, 0.87445319, -0.00880148, -0.15437943, 0.08118075, - 0.44650543, 0.85956848, -0.27865338, 2.10837507, 0.04798460, 0.43948367, -0.10185169, 0.19978794, - 1.32323360, 1.20525467, 0.44288942, -0.84200430, 0.52563053, 0.69949460, 0.73987913, 0.34668452, - 0.74545687, 0.57696682, 0.22452033, -0.27099937, 0.39649010, 0.87083614, -0.18965788, 0.58206403, - -0.08108193, 0.42067638, 1.05117214, -0.34287399, 0.20424896, 0.27994895, 0.46011117, 0.70890665, + -0.04089922f, 0.35108989f, 0.30442458f, 0.39546335f, 1.15422225f, 0.10419128f, -0.19301927f, 0.01070970f, + 0.43977541f, 0.89119899f, -0.51436460f, 1.99256825f, 1.41077507f, 0.38642293f, 0.17583044f, 0.03320138f, + 1.16508031f, -0.24356931f, 0.47440714f, -0.17844005f, 0.20463173f, 1.90038323f, 1.14138567f, 0.34504607f, + 0.16403235f, -0.24976699f, 0.29362509f, 0.34502214f, 0.41751838f, 1.09390712f, 0.12354189f, 1.83025289f, + 1.05569196f, 0.34413773f, 0.35469764f, -0.69760042f, 0.76338542f, 1.75443077f, 0.44126555f, 0.18181801f, + 0.73277575f, 0.45443264f, 0.17068321f, 0.36591727f, 0.72869974f, -0.56090516f, 0.14415455f, 1.47314119f, + 0.42908576f, 0.73084539f, -0.22373237f, 2.26550221f, 0.05606699f, 0.39417523f, 0.35234636f, 0.78569502f, + 0.77521765f, -0.65131050f, 0.40168875f, 0.45527256f, 0.38715565f, 0.98521245f, 2.21446753f, 0.36345237f, + -0.33269632f, 0.36558092f, 1.36846578f, 1.37523413f, 0.33698002f, 0.28889543f, -0.40639281f, 1.01643157f, + 0.59668219f, 0.39197800f, 1.03101778f, 0.02551098f, -0.03612846f, -0.01371557f, 0.43444607f, 0.96746695f, + 0.60583955f, -0.10362893f, 0.40574494f, 0.38046724f, 0.87445319f, -0.00880148f, -0.15437943f, 0.08118075f, + 0.44650543f, 0.85956848f, -0.27865338f, 2.10837507f, 0.04798460f, 0.43948367f, -0.10185169f, 0.19978794f, + 1.32323360f, 1.20525467f, 0.44288942f, -0.84200430f, 0.52563053f, 0.69949460f, 0.73987913f, 0.34668452f, + 0.74545687f, 0.57696682f, 0.22452033f, -0.27099937f, 0.39649010f, 0.87083614f, -0.18965788f, 0.58206403f, + -0.08108193f, 0.42067638f, 1.05117214f, -0.34287399f, 0.20424896f, 0.27994895f, 0.46011117f, 0.70890665f, }; std::vector expected_mask_index = { 6, @@ -612,20 +625,20 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_attention) { auto test_case = test::TestCase(function, s_device); std::vector input = { - 0.91475844, 0.91523546, 0.82536930, 0.37491974, 0.22384071, 0.05941105, 0.01902100, 0.70131350, - 0.09603709, 0.44200060, 0.53106076, 0.79464376, 0.35469049, 0.25225943, 0.25179818, 0.29592562, - 0.24836586, 0.65088797, 0.93126643, 0.67980725, 0.85708112, 0.59808528, 0.46321425, 0.19301885, + 0.91475844f, 0.91523546f, 0.82536930f, 0.37491974f, 0.22384071f, 0.05941105f, 0.01902100f, 0.70131350f, + 0.09603709f, 0.44200060f, 0.53106076f, 0.79464376f, 0.35469049f, 0.25225943f, 0.25179818f, 0.29592562f, + 0.24836586f, 0.65088797f, 0.93126643f, 0.67980725f, 0.85708112f, 0.59808528f, 0.46321425f, 0.19301885f, }; std::vector output = { - 0.07966283, 0.10783536, -0.19424979, 0.54514766, 0.07965867, 0.10783093, -0.19424866, 0.54510003, - 0.07965846, 0.10783067, -0.19424550, 0.54509139, 0.07966217, 0.10783640, -0.19424903, 0.54512268, - 0.06940663, 0.10962760, -0.19698445, 0.53492010, 0.06940675, 0.10962828, -0.19698484, 0.53492326, - 0.06940714, 0.10963022, -0.19698712, 0.53494006, 0.06940673, 0.10962812, -0.19698519, 0.53492481, + 0.07966283f, 0.10783536f, -0.19424979f, 0.54514766f, 0.07965867f, 0.10783093f, -0.19424866f, 0.54510003f, + 0.07965846f, 0.10783067f, -0.19424550f, 0.54509139f, 0.07966217f, 0.10783640f, -0.19424903f, 0.54512268f, + 0.06940663f, 0.10962760f, -0.19698445f, 0.53492010f, 0.06940675f, 0.10962828f, -0.19698484f, 0.53492326f, + 0.06940714f, 0.10963022f, -0.19698712f, 0.53494006f, 0.06940673f, 0.10962812f, -0.19698519f, 0.53492481f, }; test_case.add_input(input); test_case.add_expected_output(output); - test_case.run_with_tolerance_as_fp(1e-7); + test_case.run_with_tolerance_as_fp(1e-7f); } NGRAPH_TEST(${BACKEND_NAME}, onnx_model_attention_qkv_hidden_sizes) { @@ -636,24 +649,24 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_attention_qkv_hidden_sizes) { auto test_case = test::TestCase(function, s_device); std::vector input = { - 0.56477863, 0.60309958, 0.35158035, 0.03123519, 0.81918180, 0.76905495, 0.47219241, 0.72016627, - 0.59377003, 0.91380632, 0.56797302, 0.34846428, 0.83839595, 0.16394103, 0.34676281, 0.09161621, - 0.45562279, 0.23317528, 0.37197968, 0.06727808, 0.08500192, 0.84915495, 0.68266946, 0.00227691, + 0.56477863f, 0.60309958f, 0.35158035f, 0.03123519f, 0.81918180f, 0.76905495f, 0.47219241f, 0.72016627f, + 0.59377003f, 0.91380632f, 0.56797302f, 0.34846428f, 0.83839595f, 0.16394103f, 0.34676281f, 0.09161621f, + 0.45562279f, 0.23317528f, 0.37197968f, 0.06727808f, 0.08500192f, 0.84915495f, 0.68266946f, 0.00227691f, }; std::vector output = { - -0.59370947, -0.30300471, 0.12048547, -0.09029539, 0.08041390, 0.10250041, -0.19381392, 0.55126983, - -0.59370828, -0.30301332, 0.12049319, -0.09029691, 0.08041921, 0.10250521, -0.19381438, 0.55127531, - -0.59370869, -0.30301058, 0.12049074, -0.09029643, 0.08041564, 0.10250199, -0.19381410, 0.55127168, - -0.59370929, -0.30300608, 0.12048667, -0.09029562, 0.08041184, 0.10249855, -0.19381374, 0.55126774, - -0.59681994, -0.26327702, 0.07638434, -0.06311120, 0.06671587, 0.10916986, -0.19412412, 0.51977092, - -0.59682053, -0.26328400, 0.07638102, -0.06311222, 0.06671817, 0.10917170, -0.19412397, 0.51977223, - -0.59682077, -0.26328647, 0.07637984, -0.06311259, 0.06671739, 0.10917108, -0.19412403, 0.51977175, - -0.59682101, -0.26328778, 0.07637922, -0.06311278, 0.06671065, 0.10916568, -0.19412443, 0.51976782, + -0.59370947f, -0.30300471f, 0.12048547f, -0.09029539f, 0.08041390f, 0.10250041f, -0.19381392f, 0.55126983f, + -0.59370828f, -0.30301332f, 0.12049319f, -0.09029691f, 0.08041921f, 0.10250521f, -0.19381438f, 0.55127531f, + -0.59370869f, -0.30301058f, 0.12049074f, -0.09029643f, 0.08041564f, 0.10250199f, -0.19381410f, 0.55127168f, + -0.59370929f, -0.30300608f, 0.12048667f, -0.09029562f, 0.08041184f, 0.10249855f, -0.19381374f, 0.55126774f, + -0.59681994f, -0.26327702f, 0.07638434f, -0.06311120f, 0.06671587f, 0.10916986f, -0.19412412f, 0.51977092f, + -0.59682053f, -0.26328400f, 0.07638102f, -0.06311222f, 0.06671817f, 0.10917170f, -0.19412397f, 0.51977223f, + -0.59682077f, -0.26328647f, 0.07637984f, -0.06311259f, 0.06671739f, 0.10917108f, -0.19412403f, 0.51977175f, + -0.59682101f, -0.26328778f, 0.07637922f, -0.06311278f, 0.06671065f, 0.10916568f, -0.19412443f, 0.51976782f, }; test_case.add_input(input); test_case.add_expected_output(output); - test_case.run_with_tolerance_as_fp(1e-4); + test_case.run_with_tolerance_as_fp(1e-4f); } NGRAPH_TEST(${BACKEND_NAME}, onnx_model_attention_unidirectional) { @@ -664,34 +677,34 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_attention_unidirectional) { auto test_case = test::TestCase(function, s_device); std::vector input = { - 0.89578921, 0.42421508, 0.35630688, 0.77461642, 0.65753633, 0.09723099, 0.62597734, 0.72117692, - 0.57636845, 0.17104276, 0.13245547, 0.59879875, 0.15624641, 0.44903454, 0.50483286, 0.92975074, - 0.36934483, 0.29919949, 0.57185954, 0.83036488, 0.08384345, 0.20378476, 0.74684393, 0.46716982, + 0.89578921f, 0.42421508f, 0.35630688f, 0.77461642f, 0.65753633f, 0.09723099f, 0.62597734f, 0.72117692f, + 0.57636845f, 0.17104276f, 0.13245547f, 0.59879875f, 0.15624641f, 0.44903454f, 0.50483286f, 0.92975074f, + 0.36934483f, 0.29919949f, 0.57185954f, 0.83036488f, 0.08384345f, 0.20378476f, 0.74684393f, 0.46716982f, }; std::vector output = { - 0.05604819, 0.09000472, -0.19437021, 0.52487367, 0.06211422, 0.08740954, -0.19139624, 0.52762908, - 0.06708897, 0.08992603, -0.19214047, 0.53631783, 0.06896879, 0.10248676, -0.19485690, 0.53477794, - 0.08577005, 0.12807365, -0.19762954, 0.54432857, 0.06929274, 0.10893210, -0.19599904, 0.53184807, - 0.07348281, 0.10215081, -0.19280069, 0.53552240, 0.07861833, 0.10517240, -0.19285706, 0.54126489, + 0.05604819f, 0.09000472f, -0.19437021f, 0.52487367f, 0.06211422f, 0.08740954f, -0.19139624f, 0.52762908f, + 0.06708897f, 0.08992603f, -0.19214047f, 0.53631783f, 0.06896879f, 0.10248676f, -0.19485690f, 0.53477794f, + 0.08577005f, 0.12807365f, -0.19762954f, 0.54432857f, 0.06929274f, 0.10893210f, -0.19599904f, 0.53184807f, + 0.07348281f, 0.10215081f, -0.19280069f, 0.53552240f, 0.07861833f, 0.10517240f, -0.19285706f, 0.54126489f, }; std::vector present = { - -0.60427380, -0.25958878, -0.59609234, -0.24055196, -0.59613681, -0.30088067, -0.59633607, -0.33270463, - 0.06899665, -0.09284544, 0.08059876, -0.06146053, 0.11841078, -0.10019838, 0.10605468, -0.09273906, - -0.59036821, -0.32410735, -0.60532302, -0.25127757, -0.58926487, -0.25271094, -0.58640373, -0.31730092, - 0.12509561, -0.07968873, 0.06005794, -0.08937149, 0.10523240, -0.05083811, 0.14162725, -0.07438751, - 0.05604819, 0.09000472, 0.06819826, 0.08480665, 0.07700446, 0.09494394, 0.07459175, 0.14003153, - -0.19437021, 0.52487367, -0.18843602, 0.53037173, -0.19362189, 0.55360907, -0.20299932, 0.53020388, - 0.08577005, 0.12807365, 0.05276009, 0.08972625, 0.08190014, 0.08852972, 0.09400313, 0.11423884, - -0.19762954, 0.54432857, -0.19435294, 0.51924801, -0.18643703, 0.54280555, -0.19302703, 0.55837619, + -0.60427380f, -0.25958878f, -0.59609234f, -0.24055196f, -0.59613681f, -0.30088067f, -0.59633607f, -0.33270463f, + 0.06899665f, -0.09284544f, 0.08059876f, -0.06146053f, 0.11841078f, -0.10019838f, 0.10605468f, -0.09273906f, + -0.59036821f, -0.32410735f, -0.60532302f, -0.25127757f, -0.58926487f, -0.25271094f, -0.58640373f, -0.31730092f, + 0.12509561f, -0.07968873f, 0.06005794f, -0.08937149f, 0.10523240f, -0.05083811f, 0.14162725f, -0.07438751f, + 0.05604819f, 0.09000472f, 0.06819826f, 0.08480665f, 0.07700446f, 0.09494394f, 0.07459175f, 0.14003153f, + -0.19437021f, 0.52487367f, -0.18843602f, 0.53037173f, -0.19362189f, 0.55360907f, -0.20299932f, 0.53020388f, + 0.08577005f, 0.12807365f, 0.05276009f, 0.08972625f, 0.08190014f, 0.08852972f, 0.09400313f, 0.11423884f, + -0.19762954f, 0.54432857f, -0.19435294f, 0.51924801f, -0.18643703f, 0.54280555f, -0.19302703f, 0.55837619f, }; test_case.add_input(input); test_case.add_expected_output(output); test_case.add_expected_output(present); - test_case.run_with_tolerance_as_fp(1e-7); + test_case.run_with_tolerance_as_fp(1e-7f); } -NGRAPH_TEST(${BACKEND_NAME}, onnx_model_attention_mask_index_1) { +NGRAPH_TEST(${BACKEND_NAME}, onnx_model_attention_mask_index_1f) { const auto function = onnx_import::import_onnx_model(file_util::path_join(CommonTestUtils::getExecutableDirectory(), SERIALIZED_ZOO, @@ -699,29 +712,29 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_attention_mask_index_1) { auto test_case = test::TestCase(function, s_device); std::vector input = { - 0.02841483, 0.47845092, 0.14633700, 0.54597300, 0.40160629, 0.55281311, 0.14931096, 0.64483738, - 0.96559167, 0.05262021, 0.12391864, 0.20093553, 0.74290562, 0.19367455, 0.19253619, 0.41593507, - 0.91188699, 0.61606920, 0.72673517, 0.86981291, 0.19963337, 0.22747350, 0.34308898, 0.57267183, + 0.02841483f, 0.47845092f, 0.14633700f, 0.54597300f, 0.40160629f, 0.55281311f, 0.14931096f, 0.64483738f, + 0.96559167f, 0.05262021f, 0.12391864f, 0.20093553f, 0.74290562f, 0.19367455f, 0.19253619f, 0.41593507f, + 0.91188699f, 0.61606920f, 0.72673517f, 0.86981291f, 0.19963337f, 0.22747350f, 0.34308898f, 0.57267183f, }; std::vector mask_index = { 0, 1, }; std::vector output = { - 0.08298690, 0.12711772, -0.19757506, 0.54029012, 0.08298548, 0.12711433, -0.19757731, 0.54031140, - 0.08298430, 0.12711799, -0.19757695, 0.54031777, 0.08298548, 0.12711433, -0.19757444, 0.54028159, - 0.05380550, 0.10459180, -0.19593412, 0.50907606, 0.05380550, 0.10459180, -0.19593412, 0.50907606, - 0.05380550, 0.10459180, -0.19593412, 0.50907606, 0.05380550, 0.10459180, -0.19593412, 0.50907606, + 0.08298690f, 0.12711772f, -0.19757506f, 0.54029012f, 0.08298548f, 0.12711433f, -0.19757731f, 0.54031140f, + 0.08298430f, 0.12711799f, -0.19757695f, 0.54031777f, 0.08298548f, 0.12711433f, -0.19757444f, 0.54028159f, + 0.05380550f, 0.10459180f, -0.19593412f, 0.50907606f, 0.05380550f, 0.10459180f, -0.19593412f, 0.50907606f, + 0.05380550f, 0.10459180f, -0.19593412f, 0.50907606f, 0.05380550f, 0.10459180f, -0.19593412f, 0.50907606f, }; std::vector present = { - -0.58437425, -0.29483819, -0.59927911, -0.30336475, -0.59104657, -0.37327260, -0.59078789, -0.29863101, - 0.11751597, -0.04114649, 0.09933343, -0.09884726, 0.16250694, -0.12028439, 0.09319257, -0.05129660, - -0.60341775, -0.25221461, -0.58933026, -0.31912822, -0.59271193, -0.25470981, -0.59399152, -0.32643768, - 0.05398282, -0.07468132, 0.14743008, -0.09407346, 0.10399222, -0.06682440, 0.11632499, -0.08986320, - 0.09104910, 0.12973849, 0.06917210, 0.11059431, 0.09356256, 0.12594685, 0.07814129, 0.14221822, - -0.19329809, 0.53526556, -0.19787431, 0.53673857, -0.20045389, 0.57165766, -0.19869246, 0.51749766, - 0.05380550, 0.10459180, 0.09169570, 0.09892380, 0.07746917, 0.08042616, 0.07953370, 0.12909687, - -0.19593412, 0.50907606, -0.19202785, 0.56904894, -0.18689045, 0.54643762, -0.19969353, 0.53976399, + -0.58437425f, -0.29483819f, -0.59927911f, -0.30336475f, -0.59104657f, -0.37327260f, -0.59078789f, -0.29863101f, + 0.11751597f, -0.04114649f, 0.09933343f, -0.09884726f, 0.16250694f, -0.12028439f, 0.09319257f, -0.05129660f, + -0.60341775f, -0.25221461f, -0.58933026f, -0.31912822f, -0.59271193f, -0.25470981f, -0.59399152f, -0.32643768f, + 0.05398282f, -0.07468132f, 0.14743008f, -0.09407346f, 0.10399222f, -0.06682440f, 0.11632499f, -0.08986320f, + 0.09104910f, 0.12973849f, 0.06917210f, 0.11059431f, 0.09356256f, 0.12594685f, 0.07814129f, 0.14221822f, + -0.19329809f, 0.53526556f, -0.19787431f, 0.53673857f, -0.20045389f, 0.57165766f, -0.19869246f, 0.51749766f, + 0.05380550f, 0.10459180f, 0.09169570f, 0.09892380f, 0.07746917f, 0.08042616f, 0.07953370f, 0.12909687f, + -0.19593412f, 0.50907606f, -0.19202785f, 0.56904894f, -0.18689045f, 0.54643762f, -0.19969353f, 0.53976399f, }; test_case.add_input(input); @@ -739,9 +752,9 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_attention_mask_index_2) { auto test_case = test::TestCase(function, s_device); std::vector input = { - 0.75259578, 0.81492645, 0.46713001, 0.29483622, 0.06768602, 0.95105755, 0.32065326, 0.52417183, - 0.73136383, 0.77176476, 0.60997742, 0.64625764, 0.16311000, 0.89680773, 0.01331447, 0.42468646, - 0.58711547, 0.00345124, 0.13053808, 0.46278623, 0.13786320, 0.65182054, 0.74864876, 0.81506181, + 0.75259578f, 0.81492645f, 0.46713001f, 0.29483622f, 0.06768602f, 0.95105755f, 0.32065326f, 0.52417183f, + 0.73136383f, 0.77176476f, 0.60997742f, 0.64625764f, 0.16311000f, 0.89680773f, 0.01331447f, 0.42468646f, + 0.58711547f, 0.00345124f, 0.13053808f, 0.46278623f, 0.13786320f, 0.65182054f, 0.74864876f, 0.81506181f, }; std::vector mask_index = { 3, @@ -750,20 +763,20 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_attention_mask_index_2) { 1, }; std::vector output = { - 0.07524174, 0.11320241, -0.19909523, 0.54785377, 0.06825337, 0.13981669, -0.20774621, 0.53718704, - 0.07531278, 0.12957911, -0.20330518, 0.54547405, 0.07531209, 0.12958010, -0.20330583, 0.54547292, - 0.08900890, 0.11150353, -0.18931937, 0.53757656, 0.07915881, 0.10416336, -0.18914750, 0.52921104, - 0.08285815, 0.11462159, -0.19115375, 0.53077918, 0.08285838, 0.11462225, -0.19115454, 0.53077984, + 0.07524174f, 0.11320241f, -0.19909523f, 0.54785377f, 0.06825337f, 0.13981669f, -0.20774621f, 0.53718704f, + 0.07531278f, 0.12957911f, -0.20330518f, 0.54547405f, 0.07531209f, 0.12958010f, -0.20330583f, 0.54547292f, + 0.08900890f, 0.11150353f, -0.18931937f, 0.53757656f, 0.07915881f, 0.10416336f, -0.18914750f, 0.52921104f, + 0.08285815f, 0.11462159f, -0.19115375f, 0.53077918f, 0.08285838f, 0.11462225f, -0.19115454f, 0.53077984f, }; std::vector present = { - -0.59630549, -0.28110915, -0.60274345, -0.36154836, -0.59437746, -0.33717164, -0.60134649, -0.29849592, - 0.11169122, -0.09345293, 0.11103803, -0.13096604, 0.13131849, -0.10597084, 0.10463209, -0.11332577, - -0.57949269, -0.27235535, -0.58941406, -0.25372508, -0.58658379, -0.28718373, -0.59821802, -0.32433146, - 0.13244939, -0.02865628, 0.09308393, -0.04083736, 0.10948701, -0.04423397, 0.13060363, -0.12316251, - 0.07509718, 0.08392500, 0.06825337, 0.13981669, 0.08239168, 0.11931328, 0.06770951, 0.09240761, - -0.19074154, 0.55260652, -0.20774621, 0.53718704, -0.19888818, 0.55371630, -0.19559640, 0.54754448, - 0.09983939, 0.10603377, 0.07915881, 0.10416336, 0.08655046, 0.12505992, 0.07738422, 0.09509270, - -0.18571433, 0.55095005, -0.18914750, 0.52921104, -0.19315663, 0.53234470, -0.19601485, 0.56322992, + -0.59630549f, -0.28110915f, -0.60274345f, -0.36154836f, -0.59437746f, -0.33717164f, -0.60134649f, -0.29849592f, + 0.11169122f, -0.09345293f, 0.11103803f, -0.13096604f, 0.13131849f, -0.10597084f, 0.10463209f, -0.11332577f, + -0.57949269f, -0.27235535f, -0.58941406f, -0.25372508f, -0.58658379f, -0.28718373f, -0.59821802f, -0.32433146f, + 0.13244939f, -0.02865628f, 0.09308393f, -0.04083736f, 0.10948701f, -0.04423397f, 0.13060363f, -0.12316251f, + 0.07509718f, 0.08392500f, 0.06825337f, 0.13981669f, 0.08239168f, 0.11931328f, 0.06770951f, 0.09240761f, + -0.19074154f, 0.55260652f, -0.20774621f, 0.53718704f, -0.19888818f, 0.55371630f, -0.19559640f, 0.54754448f, + 0.09983939f, 0.10603377f, 0.07915881f, 0.10416336f, 0.08655046f, 0.12505992f, 0.07738422f, 0.09509270f, + -0.18571433f, 0.55095005f, -0.18914750f, 0.52921104f, -0.19315663f, 0.53234470f, -0.19601485f, 0.56322992f, }; test_case.add_input(input); @@ -781,9 +794,9 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_attention_mask_index_3) { auto test_case = test::TestCase(function, s_device); std::vector input = { - 0.33093750, 0.39181390, 0.14586255, 0.39709702, 0.98086524, 0.03891133, 0.72234219, 0.21966648, - 0.79986620, 0.97251678, 0.04131543, 0.43971965, 0.50185394, 0.11452501, 0.88111717, 0.76076663, - 0.31870860, 0.54107893, 0.91756296, 0.58112669, 0.99117357, 0.00256292, 0.58885485, 0.93481058, + 0.33093750f, 0.39181390f, 0.14586255f, 0.39709702f, 0.98086524f, 0.03891133f, 0.72234219f, 0.21966648f, + 0.79986620f, 0.97251678f, 0.04131543f, 0.43971965f, 0.50185394f, 0.11452501f, 0.88111717f, 0.76076663f, + 0.31870860f, 0.54107893f, 0.91756296f, 0.58112669f, 0.99117357f, 0.00256292f, 0.58885485f, 0.93481058f, }; std::vector mask = { 1, @@ -796,20 +809,20 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_attention_mask_index_3) { 1, }; std::vector output = { - 0.07551830, 0.10666487, -0.19357042, 0.53683108, 0.07551410, 0.10666656, -0.19356072, 0.53684169, - 0.07552745, 0.10666100, -0.19358172, 0.53682435, 0.07552218, 0.10666317, -0.19358677, 0.53681952, - 0.09727416, 0.13513327, -0.20121223, 0.57003713, 0.09727416, 0.13513327, -0.20121223, 0.57003713, - 0.09727416, 0.13513327, -0.20121223, 0.57003713, 0.09727416, 0.13513327, -0.20121223, 0.57003713, + 0.07551830f, 0.10666487f, -0.19357042f, 0.53683108f, 0.07551410f, 0.10666656f, -0.19356072f, 0.53684169f, + 0.07552745f, 0.10666100f, -0.19358172f, 0.53682435f, 0.07552218f, 0.10666317f, -0.19358677f, 0.53681952f, + 0.09727416f, 0.13513327f, -0.20121223f, 0.57003713f, 0.09727416f, 0.13513327f, -0.20121223f, 0.57003713f, + 0.09727416f, 0.13513327f, -0.20121223f, 0.57003713f, 0.09727416f, 0.13513327f, -0.20121223f, 0.57003713f, }; std::vector present = { - -0.59174627, -0.27471560, -0.58307797, -0.25967693, -0.60766846, -0.31754097, -0.61241394, -0.26291698, - 0.09206123, -0.05307099, 0.12491645, -0.03853742, 0.08732655, -0.13050151, 0.04073093, -0.10792807, - -0.60556883, -0.34055573, -0.60474855, -0.28785610, -0.60757709, -0.32514900, -0.58872569, -0.37967020, - 0.09779400, -0.13136166, 0.07915612, -0.10649752, 0.11043755, -0.15124020, 0.16626491, -0.11274654, - 0.07639833, 0.11762549, 0.09370039, 0.09133558, 0.05661478, 0.11096847, 0.04019671, 0.10117501, - -0.19371650, 0.52530587, -0.18429738, 0.55240726, -0.20283231, 0.53265429, -0.20036045, 0.50568837, - 0.06171235, 0.12687264, 0.05802051, 0.10266830, 0.06172965, 0.08967118, 0.09727416, 0.13513327, - -0.20576829, 0.53365225, -0.19832623, 0.52809310, -0.19971462, 0.55584043, -0.20121223, 0.57003713, + -0.59174627f, -0.27471560f, -0.58307797f, -0.25967693f, -0.60766846f, -0.31754097f, -0.61241394f, -0.26291698f, + 0.09206123f, -0.05307099f, 0.12491645f, -0.03853742f, 0.08732655f, -0.13050151f, 0.04073093f, -0.10792807f, + -0.60556883f, -0.34055573f, -0.60474855f, -0.28785610f, -0.60757709f, -0.32514900f, -0.58872569f, -0.37967020f, + 0.09779400f, -0.13136166f, 0.07915612f, -0.10649752f, 0.11043755f, -0.15124020f, 0.16626491f, -0.11274654f, + 0.07639833f, 0.11762549f, 0.09370039f, 0.09133558f, 0.05661478f, 0.11096847f, 0.04019671f, 0.10117501f, + -0.19371650f, 0.52530587f, -0.18429738f, 0.55240726f, -0.20283231f, 0.53265429f, -0.20036045f, 0.50568837f, + 0.06171235f, 0.12687264f, 0.05802051f, 0.10266830f, 0.06172965f, 0.08967118f, 0.09727416f, 0.13513327f, + -0.20576829f, 0.53365225f, -0.19832623f, 0.52809310f, -0.19971462f, 0.55584043f, -0.20121223f, 0.57003713f, }; test_case.add_input(input); @@ -827,28 +840,28 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_attention_mask_index_4) { auto test_case = test::TestCase(function, s_device); std::vector input = { - 0.23565151, 0.58627969, 0.75137484, 0.68586946, 0.62750375, 0.13284931, 0.13347220, 0.36357051, - 0.56910241, 0.48275986, 0.49440190, 0.45483324, 0.63547862, 0.97893149, 0.40630588, 0.38783622, - 0.07172249, 0.46385381, 0.99764502, 0.22219376, 0.67735291, 0.40799847, 0.74337566, 0.87263006, + 0.23565151f, 0.58627969f, 0.75137484f, 0.68586946f, 0.62750375f, 0.13284931f, 0.13347220f, 0.36357051f, + 0.56910241f, 0.48275986f, 0.49440190f, 0.45483324f, 0.63547862f, 0.97893149f, 0.40630588f, 0.38783622f, + 0.07172249f, 0.46385381f, 0.99764502f, 0.22219376f, 0.67735291f, 0.40799847f, 0.74337566f, 0.87263006f, }; std::vector mask = { 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, }; std::vector output = { - 0.07771622, 0.10724538, -0.19453585, 0.54342043, 0.07459468, 0.10934003, -0.19561143, 0.53936625, - 0.07927690, 0.10619678, -0.19399606, 0.54543519, 0.07459468, 0.10934003, -0.19561143, 0.53936625, - 0.05485561, 0.11278091, -0.20117569, 0.52096349, 0.06629646, 0.10195158, -0.19900991, 0.54654449, - 0.06491723, 0.10292297, -0.19678673, 0.53451663, 0.06549793, 0.11126325, -0.19989857, 0.53717279, + 0.07771622f, 0.10724538f, -0.19453585f, 0.54342043f, 0.07459468f, 0.10934003f, -0.19561143f, 0.53936625f, + 0.07927690f, 0.10619678f, -0.19399606f, 0.54543519f, 0.07459468f, 0.10934003f, -0.19561143f, 0.53936625f, + 0.05485561f, 0.11278091f, -0.20117569f, 0.52096349f, 0.06629646f, 0.10195158f, -0.19900991f, 0.54654449f, + 0.06491723f, 0.10292297f, -0.19678673f, 0.53451663f, 0.06549793f, 0.11126325f, -0.19989857f, 0.53717279f, }; std::vector present = { - -0.59188855, -0.34495637, -0.59508181, -0.25013468, -0.59176934, -0.33229247, -0.59576762, -0.29731843, - 0.14217430, -0.10403840, 0.08584045, -0.06193545, 0.12358667, -0.08588549, 0.10515238, -0.08629489, - -0.59092808, -0.28260738, -0.60047609, -0.30411413, -0.61210287, -0.28645760, -0.59391296, -0.34649473, - 0.12789863, -0.08159252, 0.08122411, -0.08866425, 0.06395009, -0.12896645, 0.14855847, -0.11978809, - 0.08783118, 0.12152332, 0.07067389, 0.09078297, 0.08385989, 0.13306075, 0.07459468, 0.10934003, - -0.19849420, 0.55928540, -0.18948570, 0.53154731, -0.19960676, 0.54237455, -0.19561143, 0.53936625, - 0.08509844, 0.08314656, 0.06388859, 0.12990499, 0.04582624, 0.09566365, 0.08674107, 0.10823163, - -0.18808734, 0.56137776, -0.20168513, 0.51830697, -0.20066255, 0.52363914, -0.19737384, 0.56921995, + -0.59188855f, -0.34495637f, -0.59508181f, -0.25013468f, -0.59176934f, -0.33229247f, -0.59576762f, -0.29731843f, + 0.14217430f, -0.10403840f, 0.08584045f, -0.06193545f, 0.12358667f, -0.08588549f, 0.10515238f, -0.08629489f, + -0.59092808f, -0.28260738f, -0.60047609f, -0.30411413f, -0.61210287f, -0.28645760f, -0.59391296f, -0.34649473f, + 0.12789863f, -0.08159252f, 0.08122411f, -0.08866425f, 0.06395009f, -0.12896645f, 0.14855847f, -0.11978809f, + 0.08783118f, 0.12152332f, 0.07067389f, 0.09078297f, 0.08385989f, 0.13306075f, 0.07459468f, 0.10934003f, + -0.19849420f, 0.55928540f, -0.18948570f, 0.53154731f, -0.19960676f, 0.54237455f, -0.19561143f, 0.53936625f, + 0.08509844f, 0.08314656f, 0.06388859f, 0.12990499f, 0.04582624f, 0.09566365f, 0.08674107f, 0.10823163f, + -0.18808734f, 0.56137776f, -0.20168513f, 0.51830697f, -0.20066255f, 0.52363914f, -0.19737384f, 0.56921995f, }; test_case.add_input(input); @@ -866,9 +879,9 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_attention_past) { auto test_case = test::TestCase(function, s_device); std::vector input = { - 0.82966000, 0.77751911, 0.08977074, 0.06076468, 0.40659550, 0.19995944, 0.55544919, 0.83971608, - 0.86254036, 0.30894691, 0.80156928, 0.83092463, 0.14506543, 0.32196075, 0.42209163, 0.24465553, - 0.93944097, 0.73528159, 0.23347616, 0.60544974, 0.93329269, 0.67604774, 0.56349903, 0.26199624, + 0.82966000f, 0.77751911f, 0.08977074f, 0.06076468f, 0.40659550f, 0.19995944f, 0.55544919f, 0.83971608f, + 0.86254036f, 0.30894691f, 0.80156928f, 0.83092463f, 0.14506543f, 0.32196075f, 0.42209163f, 0.24465553f, + 0.93944097f, 0.73528159f, 0.23347616f, 0.60544974f, 0.93329269f, 0.67604774f, 0.56349903f, 0.26199624f, }; std::vector mask = { 1, @@ -891,41 +904,42 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_attention_past) { 1, }; std::vector past = { - 0.92467678, 0.79873562, 0.00939191, 0.34891853, 0.35521412, 0.21872006, 0.89974332, 0.74132687, 0.73566031, - 0.75168055, 0.06773245, 0.85702997, 0.76256698, 0.51739877, 0.91567177, 0.66617578, 0.88056499, 0.08436447, - 0.54744655, 0.25466520, 0.08500137, 0.19271941, 0.86525357, 0.21717627, 0.97158766, 0.42288730, 0.09890039, - 0.01148765, 0.97024685, 0.19697112, 0.67671591, 0.67960924, 0.46656516, 0.30850092, 0.73536104, 0.73938161, - 0.91650903, 0.57628596, 0.51164514, 0.11695814, 0.79792547, 0.97192264, 0.29246020, 0.41030061, 0.19014873, - 0.90233624, 0.84986305, 0.26141909, 0.84528726, 0.81416380, 0.00429944, 0.31476986, 0.00440918, 0.77413058, - 0.13409913, 0.20965169, 0.61764991, 0.55266041, 0.56107825, 0.42051074, 0.16804738, 0.80362344, 0.52392679, - 0.27550557, 0.66738850, 0.39348483, 0.31801429, 0.30325863, 0.37068403, 0.92767614, 0.60799408, 0.01458820, - 0.24194679, 0.59596598, 0.81762302, 0.38094005, 0.16618672, 0.92488551, 0.84298438, 0.21752745, + 0.92467678f, 0.79873562f, 0.00939191f, 0.34891853f, 0.35521412f, 0.21872006f, 0.89974332f, 0.74132687f, + 0.73566031f, 0.75168055f, 0.06773245f, 0.85702997f, 0.76256698f, 0.51739877f, 0.91567177f, 0.66617578f, + 0.88056499f, 0.08436447f, 0.54744655f, 0.25466520f, 0.08500137f, 0.19271941f, 0.86525357f, 0.21717627f, + 0.97158766f, 0.42288730f, 0.09890039f, 0.01148765f, 0.97024685f, 0.19697112f, 0.67671591f, 0.67960924f, + 0.46656516f, 0.30850092f, 0.73536104f, 0.73938161f, 0.91650903f, 0.57628596f, 0.51164514f, 0.11695814f, + 0.79792547f, 0.97192264f, 0.29246020f, 0.41030061f, 0.19014873f, 0.90233624f, 0.84986305f, 0.26141909f, + 0.84528726f, 0.81416380f, 0.00429944f, 0.31476986f, 0.00440918f, 0.77413058f, 0.13409913f, 0.20965169f, + 0.61764991f, 0.55266041f, 0.56107825f, 0.42051074f, 0.16804738f, 0.80362344f, 0.52392679f, 0.27550557f, + 0.66738850f, 0.39348483f, 0.31801429f, 0.30325863f, 0.37068403f, 0.92767614f, 0.60799408f, 0.01458820f, + 0.24194679f, 0.59596598f, 0.81762302f, 0.38094005f, 0.16618672f, 0.92488551f, 0.84298438f, 0.21752745f, }; std::vector output = { - 0.26186451, 0.45950246, -0.04001215, 0.47680017, 0.26333901, 0.46158865, -0.04006424, 0.47588652, - 0.26875457, 0.47031689, -0.03951600, 0.47674999, 0.26851410, 0.46987134, -0.03919901, 0.47629333, - 0.18083976, 0.16579385, -0.05161894, 0.63075018, 0.18228555, 0.16642828, -0.04873618, 0.63316816, - 0.18362364, 0.16702136, -0.05045432, 0.63178891, 0.18000112, 0.16541445, -0.05139139, 0.63105792, + 0.26186451f, 0.45950246f, -0.04001215f, 0.47680017f, 0.26333901f, 0.46158865f, -0.04006424f, 0.47588652f, + 0.26875457f, 0.47031689f, -0.03951600f, 0.47674999f, 0.26851410f, 0.46987134f, -0.03919901f, 0.47629333f, + 0.18083976f, 0.16579385f, -0.05161894f, 0.63075018f, 0.18228555f, 0.16642828f, -0.04873618f, 0.63316816f, + 0.18362364f, 0.16702136f, -0.05045432f, 0.63178891f, 0.18000112f, 0.16541445f, -0.05139139f, 0.63105792f, }; std::vector present = { - 0.92467678, 0.79873562, 0.00939191, 0.34891853, 0.35521412, 0.21872006, 0.89974332, 0.74132687, - 0.73566031, 0.75168055, -0.59527576, -0.23625080, -0.58657664, -0.29827437, -0.59528387, -0.33578828, - -0.59068960, -0.34870598, 0.06773245, 0.85702997, 0.76256698, 0.51739877, 0.91567177, 0.66617578, - 0.88056499, 0.08436447, 0.54744655, 0.25466520, 0.08536442, -0.06134639, 0.11295843, -0.04818217, - 0.14562836, -0.12305059, 0.15695867, -0.11161390, 0.08500137, 0.19271941, 0.86525357, 0.21717627, - 0.97158766, 0.42288730, 0.09890039, 0.01148765, 0.97024685, 0.19697112, -0.59141791, -0.31600696, - -0.58647990, -0.34302223, -0.59306550, -0.36427227, -0.59695083, -0.26431620, 0.67671591, 0.67960924, - 0.46656516, 0.30850092, 0.73536104, 0.73938161, 0.91650903, 0.57628596, 0.51164514, 0.11695814, - 0.11255538, -0.07302766, 0.16620418, -0.09871224, 0.15272795, -0.12076923, 0.08827571, -0.07442430, - 0.79792547, 0.97192264, 0.29246020, 0.41030061, 0.19014873, 0.90233624, 0.84986305, 0.26141909, - 0.84528726, 0.81416380, 0.07014155, 0.07749540, 0.08745074, 0.13131952, 0.08430066, 0.09709007, - 0.09247591, 0.11065811, 0.00429944, 0.31476986, 0.00440918, 0.77413058, 0.13409913, 0.20965169, - 0.61764991, 0.55266041, 0.56107825, 0.42051074, -0.18658412, 0.53568852, -0.19482780, 0.53271860, - -0.19558203, 0.57155901, -0.19633618, 0.57260245, 0.16804738, 0.80362344, 0.52392679, 0.27550557, - 0.66738850, 0.39348483, 0.31801429, 0.30325863, 0.37068403, 0.92767614, 0.08172131, 0.13249113, - 0.09947956, 0.10781212, 0.08890627, 0.12280971, 0.06911418, 0.09499176, 0.60799408, 0.01458820, - 0.24194679, 0.59596598, 0.81762302, 0.38094005, 0.16618672, 0.92488551, 0.84298438, 0.21752745, - -0.19839945, 0.53462923, -0.19349247, 0.57778782, -0.20039621, 0.56689924, -0.19190890, 0.53286803, + 0.92467678f, 0.79873562f, 0.00939191f, 0.34891853f, 0.35521412f, 0.21872006f, 0.89974332f, 0.74132687f, + 0.73566031f, 0.75168055f, -0.59527576f, -0.23625080f, -0.58657664f, -0.29827437f, -0.59528387f, -0.33578828f, + -0.59068960f, -0.34870598f, 0.06773245f, 0.85702997f, 0.76256698f, 0.51739877f, 0.91567177f, 0.66617578f, + 0.88056499f, 0.08436447f, 0.54744655f, 0.25466520f, 0.08536442f, -0.06134639f, 0.11295843f, -0.04818217f, + 0.14562836f, -0.12305059f, 0.15695867f, -0.11161390f, 0.08500137f, 0.19271941f, 0.86525357f, 0.21717627f, + 0.97158766f, 0.42288730f, 0.09890039f, 0.01148765f, 0.97024685f, 0.19697112f, -0.59141791f, -0.31600696f, + -0.58647990f, -0.34302223f, -0.59306550f, -0.36427227f, -0.59695083f, -0.26431620f, 0.67671591f, 0.67960924f, + 0.46656516f, 0.30850092f, 0.73536104f, 0.73938161f, 0.91650903f, 0.57628596f, 0.51164514f, 0.11695814f, + 0.11255538f, -0.07302766f, 0.16620418f, -0.09871224f, 0.15272795f, -0.12076923f, 0.08827571f, -0.07442430f, + 0.79792547f, 0.97192264f, 0.29246020f, 0.41030061f, 0.19014873f, 0.90233624f, 0.84986305f, 0.26141909f, + 0.84528726f, 0.81416380f, 0.07014155f, 0.07749540f, 0.08745074f, 0.13131952f, 0.08430066f, 0.09709007f, + 0.09247591f, 0.11065811f, 0.00429944f, 0.31476986f, 0.00440918f, 0.77413058f, 0.13409913f, 0.20965169f, + 0.61764991f, 0.55266041f, 0.56107825f, 0.42051074f, -0.18658412f, 0.53568852f, -0.19482780f, 0.53271860f, + -0.19558203f, 0.57155901f, -0.19633618f, 0.57260245f, 0.16804738f, 0.80362344f, 0.52392679f, 0.27550557f, + 0.66738850f, 0.39348483f, 0.31801429f, 0.30325863f, 0.37068403f, 0.92767614f, 0.08172131f, 0.13249113f, + 0.09947956f, 0.10781212f, 0.08890627f, 0.12280971f, 0.06911418f, 0.09499176f, 0.60799408f, 0.01458820f, + 0.24194679f, 0.59596598f, 0.81762302f, 0.38094005f, 0.16618672f, 0.92488551f, 0.84298438f, 0.21752745f, + -0.19839945f, 0.53462923f, -0.19349247f, 0.57778782f, -0.20039621f, 0.56689924f, -0.19190890f, 0.53286803f, }; test_case.add_input(input); @@ -944,9 +958,9 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_attention_extra_add) { auto test_case = test::TestCase(function, s_device); std::vector input = { - 0.14930259, 0.11199699, 0.81292826, 0.08368169, 0.05704883, 0.41276145, 0.38760167, 0.00146112, - 0.14275745, 0.54254925, 0.07962929, 0.31023681, 0.09597706, 0.60583973, 0.90233743, 0.33360451, - 0.18193199, 0.19159532, 0.07869831, 0.86026299, 0.20683478, 0.40150928, 0.93124926, 0.31805834, + 0.14930259f, 0.11199699f, 0.81292826f, 0.08368169f, 0.05704883f, 0.41276145f, 0.38760167f, 0.00146112f, + 0.14275745f, 0.54254925f, 0.07962929f, 0.31023681f, 0.09597706f, 0.60583973f, 0.90233743f, 0.33360451f, + 0.18193199f, 0.19159532f, 0.07869831f, 0.86026299f, 0.20683478f, 0.40150928f, 0.93124926f, 0.31805834f, }; std::vector mask = { 0, @@ -959,30 +973,30 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_attention_extra_add) { 0, }; std::vector extra_add = { - 0.73230380, 0.61824518, 0.19738488, 0.57034588, 0.22331032, 0.53262889, 0.60098642, 0.72943515, - 0.09009175, 0.81116527, 0.47240964, 0.49679127, 0.41110733, 0.29418564, 0.93818313, 0.64175284, - 0.06807775, 0.66733366, 0.78848422, 0.48788327, 0.38806340, 0.14002480, 0.72263688, 0.22772972, - 0.24000823, 0.75820386, 0.64254439, 0.19385594, 0.95595860, 0.59840417, 0.93769604, 0.62474734, - 0.36690548, 0.76047903, 0.62352085, 0.58574778, 0.64251810, 0.78072041, 0.43344691, 0.75383639, - 0.73950553, 0.92625278, 0.05066428, 0.08448382, 0.25980917, 0.50312829, 0.97800279, 0.05422170, - 0.05171391, 0.82828254, 0.42234898, 0.95752198, 0.96325767, 0.97909677, 0.35578200, 0.48091716, - 0.03637243, 0.91552693, 0.43403026, 0.94275808, 0.51182085, 0.86773109, 0.38459453, 0.87822068, + 0.73230380f, 0.61824518f, 0.19738488f, 0.57034588f, 0.22331032f, 0.53262889f, 0.60098642f, 0.72943515f, + 0.09009175f, 0.81116527f, 0.47240964f, 0.49679127f, 0.41110733f, 0.29418564f, 0.93818313f, 0.64175284f, + 0.06807775f, 0.66733366f, 0.78848422f, 0.48788327f, 0.38806340f, 0.14002480f, 0.72263688f, 0.22772972f, + 0.24000823f, 0.75820386f, 0.64254439f, 0.19385594f, 0.95595860f, 0.59840417f, 0.93769604f, 0.62474734f, + 0.36690548f, 0.76047903f, 0.62352085f, 0.58574778f, 0.64251810f, 0.78072041f, 0.43344691f, 0.75383639f, + 0.73950553f, 0.92625278f, 0.05066428f, 0.08448382f, 0.25980917f, 0.50312829f, 0.97800279f, 0.05422170f, + 0.05171391f, 0.82828254f, 0.42234898f, 0.95752198f, 0.96325767f, 0.97909677f, 0.35578200f, 0.48091716f, + 0.03637243f, 0.91552693f, 0.43403026f, 0.94275808f, 0.51182085f, 0.86773109f, 0.38459453f, 0.87822068f, }; std::vector output = { - 0.06090815, 0.12919067, -0.19883196, 0.50295448, 0.06090815, 0.12919067, -0.19883196, 0.50295448, - 0.06090815, 0.12919067, -0.19883196, 0.50295448, 0.06090815, 0.12919067, -0.19883196, 0.50295448, - 0.08714182, 0.12259886, -0.19516067, 0.54010558, 0.08671370, 0.12369543, -0.19658084, 0.54502594, - 0.08458151, 0.12488046, -0.19519810, 0.53906947, 0.09063499, 0.12088943, -0.19583938, 0.54266596, + 0.06090815f, 0.12919067f, -0.19883196f, 0.50295448f, 0.06090815f, 0.12919067f, -0.19883196f, 0.50295448f, + 0.06090815f, 0.12919067f, -0.19883196f, 0.50295448f, 0.06090815f, 0.12919067f, -0.19883196f, 0.50295448f, + 0.08714182f, 0.12259886f, -0.19516067f, 0.54010558f, 0.08671370f, 0.12369543f, -0.19658084f, 0.54502594f, + 0.08458151f, 0.12488046f, -0.19519810f, 0.53906947f, 0.09063499f, 0.12088943f, -0.19583938f, 0.54266596f, }; std::vector present = { - -0.59800303, -0.35666457, -0.59420627, -0.31881350, -0.59887993, -0.27025288, -0.60216135, -0.27772796, - 0.11659990, -0.11224300, 0.09693416, -0.07304113, 0.06023501, -0.05941332, 0.06434284, -0.07978789, - -0.59005713, -0.37009716, -0.59542215, -0.27914333, -0.57998544, -0.29826957, -0.58625919, -0.28872511, - 0.15994480, -0.11288825, 0.07906821, -0.05991337, 0.14479136, -0.04415035, 0.13493451, -0.06541853, - 0.07513385, 0.14411135, 0.07505661, 0.14532046, 0.06090815, 0.12919067, 0.05788904, 0.12018456, - -0.20586906, 0.53715372, -0.20203318, 0.52092510, -0.19883196, 0.50295448, -0.19937295, 0.51055026, - 0.09417956, 0.12943678, 0.06923291, 0.12574309, 0.10221909, 0.11366953, 0.09235901, 0.09584601, - -0.20036517, 0.56818324, -0.19709785, 0.51547027, -0.18871340, 0.55736589, -0.18826833, 0.55965197, + -0.59800303f, -0.35666457f, -0.59420627f, -0.31881350f, -0.59887993f, -0.27025288f, -0.60216135f, -0.27772796f, + 0.11659990f, -0.11224300f, 0.09693416f, -0.07304113f, 0.06023501f, -0.05941332f, 0.06434284f, -0.07978789f, + -0.59005713f, -0.37009716f, -0.59542215f, -0.27914333f, -0.57998544f, -0.29826957f, -0.58625919f, -0.28872511f, + 0.15994480f, -0.11288825f, 0.07906821f, -0.05991337f, 0.14479136f, -0.04415035f, 0.13493451f, -0.06541853f, + 0.07513385f, 0.14411135f, 0.07505661f, 0.14532046f, 0.06090815f, 0.12919067f, 0.05788904f, 0.12018456f, + -0.20586906f, 0.53715372f, -0.20203318f, 0.52092510f, -0.19883196f, 0.50295448f, -0.19937295f, 0.51055026f, + 0.09417956f, 0.12943678f, 0.06923291f, 0.12574309f, 0.10221909f, 0.11366953f, 0.09235901f, 0.09584601f, + -0.20036517f, 0.56818324f, -0.19709785f, 0.51547027f, -0.18871340f, 0.55736589f, -0.18826833f, 0.55965197f, }; test_case.add_input(input); @@ -1001,29 +1015,30 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_attention_dynamic_shapes) { auto test_case = test::TestCase(function, s_device); std::vector input = { - 0.42226878, 0.50984067, 0.80440795, 0.68040705, 0.93614250, 0.45104721, 0.71767306, 0.48596525, - 0.70076728, 0.04500086, 0.28930107, 0.77435863, 0.19392140, 0.90290719, 0.91955870, 0.58811885, - 0.76795286, 0.62884814, 0.23377730, 0.49212688, 0.87256873, 0.11944817, 0.57715887, 0.91886938, + 0.42226878f, 0.50984067f, 0.80440795f, 0.68040705f, 0.93614250f, 0.45104721f, 0.71767306f, 0.48596525f, + 0.70076728f, 0.04500086f, 0.28930107f, 0.77435863f, 0.19392140f, 0.90290719f, 0.91955870f, 0.58811885f, + 0.76795286f, 0.62884814f, 0.23377730f, 0.49212688f, 0.87256873f, 0.11944817f, 0.57715887f, 0.91886938f, }; std::vector weights = { - 0.99377930, 0.22733542, 0.43217131, 0.60717988, 0.97224706, 0.70020503, 0.92439449, 0.41512674, 0.47728160, - 0.40306625, 0.72619593, 0.37954643, 0.36950976, 0.84305370, 0.61671126, 0.22251014, 0.73839295, 0.73471880, - 0.37428924, 0.80240524, 0.23120961, 0.06072779, 0.92840081, 0.71558088, 0.08719950, 0.51666921, 0.53768843, - 0.48113129, 0.46389169, 0.01036468, 0.37341005, 0.67195475, 0.53599644, 0.41795707, 0.58081782, 0.97939289, + 0.99377930f, 0.22733542f, 0.43217131f, 0.60717988f, 0.97224706f, 0.70020503f, 0.92439449f, 0.41512674f, + 0.47728160f, 0.40306625f, 0.72619593f, 0.37954643f, 0.36950976f, 0.84305370f, 0.61671126f, 0.22251014f, + 0.73839295f, 0.73471880f, 0.37428924f, 0.80240524f, 0.23120961f, 0.06072779f, 0.92840081f, 0.71558088f, + 0.08719950f, 0.51666921f, 0.53768843f, 0.48113129f, 0.46389169f, 0.01036468f, 0.37341005f, 0.67195475f, + 0.53599644f, 0.41795707f, 0.58081782f, 0.97939289f, }; std::vector bias = { - 0.77122736, - 0.75600564, - 0.86177206, - 0.69982684, - 0.74719858, - 0.78054035, - 0.80007398, - 0.74902135, - 0.81258053, - 0.01575289, - 0.08463049, - 0.39671996, + 0.77122736f, + 0.75600564f, + 0.86177206f, + 0.69982684f, + 0.74719858f, + 0.78054035f, + 0.80007398f, + 0.74902135f, + 0.81258053f, + 0.01575289f, + 0.08463049f, + 0.39671996f, }; std::vector mask = { 0, @@ -1046,39 +1061,42 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_attention_dynamic_shapes) { 0, }; std::vector past = { - 0.27759778, 0.18458818, 0.63114458, 0.09953160, 0.59739488, 0.63917851, 0.18828323, 0.65625650, 0.84574437, - 0.91846281, 0.55102497, 0.27506110, 0.06816208, 0.82616585, 0.85912132, 0.88682729, 0.14730524, 0.61618829, - 0.89891797, 0.27753425, 0.57438278, 0.33753166, 0.88768929, 0.35533753, 0.30193496, 0.81678063, 0.26569194, - 0.62769043, 0.61990744, 0.59077013, 0.11058200, 0.97370809, 0.81339806, 0.57207322, 0.80417949, 0.54185718, - 0.80831683, 0.29390740, 0.29051417, 0.51964313, 0.04341308, 0.05925354, 0.82397246, 0.55753845, 0.61247689, - 0.98571628, 0.07566493, 0.37537411, 0.42080343, 0.21715857, 0.57869565, 0.55962265, 0.82500041, 0.60776925, - 0.19367239, 0.88382334, 0.20328504, 0.58192456, 0.94542676, 0.98562658, 0.64355153, 0.69856495, 0.30377558, - 0.02857198, 0.96969068, 0.48450547, 0.98341352, 0.03546083, 0.84963584, 0.94460547, 0.90907097, 0.22525074, - 0.12530145, 0.52223104, 0.09549426, 0.93127102, 0.93429947, 0.01428344, 0.74249738, 0.22606593, + 0.27759778f, 0.18458818f, 0.63114458f, 0.09953160f, 0.59739488f, 0.63917851f, 0.18828323f, 0.65625650f, + 0.84574437f, 0.91846281f, 0.55102497f, 0.27506110f, 0.06816208f, 0.82616585f, 0.85912132f, 0.88682729f, + 0.14730524f, 0.61618829f, 0.89891797f, 0.27753425f, 0.57438278f, 0.33753166f, 0.88768929f, 0.35533753f, + 0.30193496f, 0.81678063f, 0.26569194f, 0.62769043f, 0.61990744f, 0.59077013f, 0.11058200f, 0.97370809f, + 0.81339806f, 0.57207322f, 0.80417949f, 0.54185718f, 0.80831683f, 0.29390740f, 0.29051417f, 0.51964313f, + 0.04341308f, 0.05925354f, 0.82397246f, 0.55753845f, 0.61247689f, 0.98571628f, 0.07566493f, 0.37537411f, + 0.42080343f, 0.21715857f, 0.57869565f, 0.55962265f, 0.82500041f, 0.60776925f, 0.19367239f, 0.88382334f, + 0.20328504f, 0.58192456f, 0.94542676f, 0.98562658f, 0.64355153f, 0.69856495f, 0.30377558f, 0.02857198f, + 0.96969068f, 0.48450547f, 0.98341352f, 0.03546083f, 0.84963584f, 0.94460547f, 0.90907097f, 0.22525074f, + 0.12530145f, 0.52223104f, 0.09549426f, 0.93127102f, 0.93429947f, 0.01428344f, 0.74249738f, 0.22606593f, }; std::vector output = { - 1.47439122, 0.50951630, 1.17974961, 1.58501005, 1.49403512, 0.51560062, 1.18972027, 1.59668207, - 1.48384988, 0.51248586, 1.18596375, 1.59219086, 1.44181466, 0.50219649, 1.15537691, 1.55348074, - 0.83429223, 0.59521818, 0.87688094, 0.13611843, 0.82936716, 0.61004817, 0.87633312, 0.13887596, - 0.83155584, 0.59382534, 0.87496555, 0.14041223, 0.83309680, 0.58982348, 0.87517864, 0.13930768, + 1.47439122f, 0.50951630f, 1.17974961f, 1.58501005f, 1.49403512f, 0.51560062f, 1.18972027f, 1.59668207f, + 1.48384988f, 0.51248586f, 1.18596375f, 1.59219086f, 1.44181466f, 0.50219649f, 1.15537691f, 1.55348074f, + 0.83429223f, 0.59521818f, 0.87688094f, 0.13611843f, 0.82936716f, 0.61004817f, 0.87633312f, 0.13887596f, + 0.83155584f, 0.59382534f, 0.87496555f, 0.14041223f, 0.83309680f, 0.58982348f, 0.87517864f, 0.13930768f, }; std::vector present = { - 0.27759778, 0.18458818, 0.63114458, 0.09953160, 0.59739488, 0.63917851, 0.18828323, 0.65625650, 0.84574437, - 0.91846281, 1.90736914, 1.45914197, 2.30920029, 1.94944119, 2.12886763, 1.64736962, 1.36378694, 1.03263116, - 0.55102497, 0.27506110, 0.06816208, 0.82616585, 0.85912132, 0.88682729, 0.14730524, 0.61618829, 0.89891797, - 0.27753425, 1.68161881, 1.87394094, 1.94785213, 2.08572555, 1.90705216, 1.90777159, 1.23910809, 1.52017307, - 0.57438278, 0.33753166, 0.88768929, 0.35533753, 0.30193496, 0.81678063, 0.26569194, 0.62769043, 0.61990744, - 0.59077013, 2.02901411, 1.58923888, 2.17776394, 1.76309133, 1.74264824, 1.31485105, 1.71575761, 1.29775190, - 0.11058200, 0.97370809, 0.81339806, 0.57207322, 0.80417949, 0.54185718, 0.80831683, 0.29390740, 0.29051417, - 0.51964313, 1.66065478, 2.17192268, 1.86598253, 2.03193212, 1.52620018, 1.82728052, 1.46963060, 1.87916136, - 0.04341308, 0.05925354, 0.82397246, 0.55753845, 0.61247689, 0.98571628, 0.07566493, 0.37537411, 0.42080343, - 0.21715857, 1.56316149, 0.55312467, 1.59553123, 0.53537023, 1.64308119, 0.62742490, 1.31600118, 0.37510848, - 0.57869565, 0.55962265, 0.82500041, 0.60776925, 0.19367239, 0.88382334, 0.20328504, 0.58192456, 0.94542676, - 0.98562658, 1.33183134, 1.70965421, 1.70983100, 1.76660407, 1.46399045, 1.70318413, 0.83565855, 1.37921953, - 0.64355153, 0.69856495, 0.30377558, 0.02857198, 0.96969068, 0.48450547, 0.98341352, 0.03546083, 0.84963584, - 0.94460547, 1.60677671, 0.53308368, 1.60789728, 0.56227136, 1.50563633, 0.50456268, 1.49554634, 0.48299593, - 0.90907097, 0.22525074, 0.12530145, 0.52223104, 0.09549426, 0.93127102, 0.93429947, 0.01428344, 0.74249738, - 0.22606593, 1.59781134, 2.01703453, 1.58993423, 1.78536010, 1.21809304, 1.69219351, 1.24090374, 1.75499403, + 0.27759778f, 0.18458818f, 0.63114458f, 0.09953160f, 0.59739488f, 0.63917851f, 0.18828323f, 0.65625650f, + 0.84574437f, 0.91846281f, 1.90736914f, 1.45914197f, 2.30920029f, 1.94944119f, 2.12886763f, 1.64736962f, + 1.36378694f, 1.03263116f, 0.55102497f, 0.27506110f, 0.06816208f, 0.82616585f, 0.85912132f, 0.88682729f, + 0.14730524f, 0.61618829f, 0.89891797f, 0.27753425f, 1.68161881f, 1.87394094f, 1.94785213f, 2.08572555f, + 1.90705216f, 1.90777159f, 1.23910809f, 1.52017307f, 0.57438278f, 0.33753166f, 0.88768929f, 0.35533753f, + 0.30193496f, 0.81678063f, 0.26569194f, 0.62769043f, 0.61990744f, 0.59077013f, 2.02901411f, 1.58923888f, + 2.17776394f, 1.76309133f, 1.74264824f, 1.31485105f, 1.71575761f, 1.29775190f, 0.11058200f, 0.97370809f, + 0.81339806f, 0.57207322f, 0.80417949f, 0.54185718f, 0.80831683f, 0.29390740f, 0.29051417f, 0.51964313f, + 1.66065478f, 2.17192268f, 1.86598253f, 2.03193212f, 1.52620018f, 1.82728052f, 1.46963060f, 1.87916136f, + 0.04341308f, 0.05925354f, 0.82397246f, 0.55753845f, 0.61247689f, 0.98571628f, 0.07566493f, 0.37537411f, + 0.42080343f, 0.21715857f, 1.56316149f, 0.55312467f, 1.59553123f, 0.53537023f, 1.64308119f, 0.62742490f, + 1.31600118f, 0.37510848f, 0.57869565f, 0.55962265f, 0.82500041f, 0.60776925f, 0.19367239f, 0.88382334f, + 0.20328504f, 0.58192456f, 0.94542676f, 0.98562658f, 1.33183134f, 1.70965421f, 1.70983100f, 1.76660407f, + 1.46399045f, 1.70318413f, 0.83565855f, 1.37921953f, 0.64355153f, 0.69856495f, 0.30377558f, 0.02857198f, + 0.96969068f, 0.48450547f, 0.98341352f, 0.03546083f, 0.84963584f, 0.94460547f, 1.60677671f, 0.53308368f, + 1.60789728f, 0.56227136f, 1.50563633f, 0.50456268f, 1.49554634f, 0.48299593f, 0.90907097f, 0.22525074f, + 0.12530145f, 0.52223104f, 0.09549426f, 0.93127102f, 0.93429947f, 0.01428344f, 0.74249738f, 0.22606593f, + 1.59781134f, 2.01703453f, 1.58993423f, 1.78536010f, 1.21809304f, 1.69219351f, 1.24090374f, 1.75499403f, }; test_case.add_input(Shape{2, 4, 3}, input); @@ -1098,60 +1116,61 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_fusedgemm_abc) { auto test_case = test::TestCase(function, s_device); std::vector inputA = { - 0.760289272, - 0.155913759, - 0.781790674, - -0.916164881, - -0.599392663, - 0.264654594, - 0.793851873, - 0.177088557, - 0.082737454, - 0.070692121, - -0.811413035, - -0.098108588, - 0.650090827, - -0.987659751, - -0.815909968, - -0.375566031, - -0.192777789, - -0.843511765, + 0.760289272f, + 0.155913759f, + 0.781790674f, + -0.916164881f, + -0.599392663f, + 0.264654594f, + 0.793851873f, + 0.177088557f, + 0.082737454f, + 0.070692121f, + -0.811413035f, + -0.098108588f, + 0.650090827f, + -0.987659751f, + -0.815909968f, + -0.375566031f, + -0.192777789f, + -0.843511765f, }; std::vector inputB = { - -0.599338344, -0.893724541, -0.362130441, -0.510642812, -0.943908814, -0.247790266, -0.732624930, 0.660286910, - -0.264866660, -0.907203793, 0.339617010, -0.322529173, 0.714601048, 0.581729832, -0.609115490, -0.369882312, - -0.462432785, -0.554824440, -0.833489997, -0.899945507, -0.088337136, -0.253637339, -0.443307744, -0.677004897, + -0.599338344f, -0.893724541f, -0.362130441f, -0.510642812f, -0.943908814f, -0.247790266f, + -0.732624930f, 0.660286910f, -0.264866660f, -0.907203793f, 0.339617010f, -0.322529173f, + 0.714601048f, 0.581729832f, -0.609115490f, -0.369882312f, -0.462432785f, -0.554824440f, + -0.833489997f, -0.899945507f, -0.088337136f, -0.253637339f, -0.443307744f, -0.677004897f, }; std::vector inputC = { - -0.540039918, - -0.235745675, - -0.337291175, - -0.702340580, - 0.532629731, - -0.794515569, - -0.532012999, - 0.372558416, - 0.582367524, - -0.483044018, - 0.656635884, - -0.655929499, + -0.540039918f, + -0.235745675f, + -0.337291175f, + -0.702340580f, + 0.532629731f, + -0.794515569f, + -0.532012999f, + 0.372558416f, + 0.582367524f, + -0.483044018f, + 0.656635884f, + -0.655929499f, }; std::vector output = { - -8.75421E-05, - -9.65321E-05, - 0.239491309, - -2.70329E-05, - 0.151090653, - -5.53371E-05, - -1.22197E-05, - 0.413963711, - 0.618195780, - 0.011654445, - 0.815541101, - -2.46706E-05, + -8.75421E-05f, + -9.65321E-05f, + 0.239491309f, + -2.70329E-05f, + 0.151090653f, + -5.53371E-05f, + -1.22197E-05f, + 0.413963711f, + 0.618195780f, + 0.011654445f, + 0.815541101f, + -2.46706E-05f, }; test_case.add_input(Shape{3, 6}, inputA); From 7dfb440fddc21c90196a14feb09b281de5c32f81 Mon Sep 17 00:00:00 2001 From: Mateusz Bencer Date: Wed, 15 Mar 2023 21:01:34 +0100 Subject: [PATCH 11/28] fixed float cast for onnx import tests --- src/frontends/onnx/tests/onnx_import.in.cpp | 804 ++++++++++---------- 1 file changed, 418 insertions(+), 386 deletions(-) diff --git a/src/frontends/onnx/tests/onnx_import.in.cpp b/src/frontends/onnx/tests/onnx_import.in.cpp index 91ce448c02c06f..4085af9aadec08 100644 --- a/src/frontends/onnx/tests/onnx_import.in.cpp +++ b/src/frontends/onnx/tests/onnx_import.in.cpp @@ -489,21 +489,21 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_expand_context_dependent_function) { auto test_case = test::TestCase(function, s_device); test_case.add_input(Shape{3, 5}, - {0.54881352186203, - 0.7151893377304077, - 0.6027633547782898, - 0.5448831915855408, - 0.42365479469299316, - 0.6458941102027893, - 0.4375872015953064, - 0.891772985458374, - 0.9636627435684204, - 0.3834415078163147, - 0.7917250394821167, - 0.5288949012756348, - 0.5680445432662964, - 0.9255966544151306, - 0.07103605568408966}); + {0.54881352186203f, + 0.7151893377304077f, + 0.6027633547782898f, + 0.5448831915855408f, + 0.42365479469299316f, + 0.6458941102027893f, + 0.4375872015953064f, + 0.891772985458374f, + 0.9636627435684204f, + 0.3834415078163147f, + 0.7917250394821167f, + 0.5288949012756348f, + 0.5680445432662964f, + 0.9255966544151306f, + 0.07103605568408966f}); test_case.add_input(Shape{3}, {1, 4, 3}); test_case.add_expected_output(Shape{}, {1}); test_case.run(); @@ -804,20 +804,20 @@ namespace { // common input for all Softmax 3D test cases (Shape = {3,4,5}) // clang-format off const std::vector SOFTMAX_INPUT = { - 2.75793882, -0.50841322, 0.82013929, -0.62409912, -0.96136118, - 0.21004745, 1.38337255, 1.19030397, 2.0940445, -0.03551657, - -0.78686039, 1.992782, 0.04300319, -0.29230777, -0.56797112, - -1.26732165, -0.61935399, 0.57670432, 0.92844898, 2.82469233, - - 0.98721677, -0.05100663, -1.21178917, -0.17530157, 1.40051805, - -0.13259761, -1.14313018, 0.2673723, -0.87996154, 1.29053106, - 1.55, 0.8396538, 1.20729817, 0.23727845, -0.89113606, - -1.70909842, 0.26460363, -0.70566808, 2.383518, 1.07024615, - - -1.21722605, 0.82919357, 0.55765697, 0.12657686, 0.63432172, - 0.75425957, -2.43721014, -1.24478184, 2.65316853, 1.19509542, - -0.95523998, 0.5149006, -0.01151649, 0.68327026, -0.4589638, - -0.46554745, 0.21055324, 0.39266729, 2.05098086, 1.83207919}; + 2.75793882f, -0.50841322f, 0.82013929f, -0.62409912f, -0.96136118f, + 0.21004745f, 1.38337255f, 1.19030397f, 2.0940445f, -0.03551657f, + -0.78686039f, 1.992782f, 0.04300319f, -0.29230777f, -0.56797112f, + -1.26732165f, -0.61935399f, 0.57670432f, 0.92844898f, 2.82469233f, + + 0.98721677f, -0.05100663f, -1.21178917f, -0.17530157f, 1.40051805f, + -0.13259761f, -1.14313018f, 0.2673723f, -0.87996154f, 1.29053106f, + 1.55f, 0.8396538f, 1.20729817f, 0.23727845f, -0.89113606f, + -1.70909842f, 0.26460363f, -0.70566808f, 2.383518f, 1.07024615f, + + -1.21722605f, 0.82919357f, 0.55765697f, 0.12657686f, 0.63432172f, + 0.75425957f, -2.43721014f, -1.24478184f, 2.65316853f, 1.19509542f, + -0.95523998f, 0.5149006f, -0.01151649f, 0.68327026f, -0.4589638f, + -0.46554745f, 0.21055324f, 0.39266729f, 2.05098086f, 1.83207919f}; } // namespace // clang-format on @@ -831,20 +831,20 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_softmax_axis_0) { // clang-format off test_case.add_expected_output( Shape{3, 4, 5}, - {0.09683057, 0.00369363, 0.01394559, 0.00329012, 0.00234823, - 0.00757665, 0.02449322, 0.02019284, 0.04985249, 0.00592694, - 0.00279593, 0.04505148, 0.00641108, 0.00458466, 0.00348007, - 0.00172928, 0.00330577, 0.01093237, 0.01554086, 0.10351497, - - 0.01648154, 0.00583583, 0.00182802, 0.00515374, 0.02491679, - 0.00537859, 0.00195794, 0.00802367, 0.00254737, 0.0223216, - 0.02893419, 0.0142204, 0.02053893, 0.00778581, 0.00251907, - 0.00111174, 0.00800149, 0.0030324, 0.06658917, 0.0179084, - - 0.00181811, 0.01407243, 0.01072611, 0.0069699, 0.01158077, - 0.01305647, 0.00053677, 0.0017687, 0.08719896, 0.02028982, - 0.00236265, 0.01027717, 0.0060709, 0.01216173, 0.00388087, - 0.00385541, 0.00758048, 0.00909469, 0.04775123, 0.03836337}); + {0.09683057f, 0.00369363f, 0.01394559f, 0.00329012f, 0.00234823f, + 0.00757665f, 0.02449322f, 0.02019284f, 0.04985249f, 0.00592694f, + 0.00279593f, 0.04505148f, 0.00641108f, 0.00458466f, 0.00348007f, + 0.00172928f, 0.00330577f, 0.01093237f, 0.01554086f, 0.10351497f, + + 0.01648154f, 0.00583583f, 0.00182802f, 0.00515374f, 0.02491679f, + 0.00537859f, 0.00195794f, 0.00802367f, 0.00254737f, 0.0223216f, + 0.02893419f, 0.0142204f, 0.02053893f, 0.00778581f, 0.00251907f, + 0.00111174f, 0.00800149f, 0.0030324f, 0.06658917f, 0.0179084f, + + 0.00181811f, 0.01407243f, 0.01072611f, 0.0069699f, 0.01158077f, + 0.01305647f, 0.00053677f, 0.0017687f, 0.08719896f, 0.02028982f, + 0.00236265f, 0.01027717f, 0.0060709f, 0.01216173f, 0.00388087f, + 0.00385541f, 0.00758048f, 0.00909469f, 0.04775123f, 0.03836337f}); // clang-format on test_case.run(6); @@ -860,20 +860,20 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_softmax_axis_1) { // clang-format off test_case.add_expected_output( Shape{3, 4, 5}, - {0.22757064, 0.00868076, 0.03277484, 0.00773243, 0.0055188, - 0.0178066, 0.05756383, 0.04745709, 0.11716303, 0.01392945, - 0.00657097, 0.10587974, 0.01506727, 0.01077484, 0.00817884, - 0.00406413, 0.00776921, 0.0256932, 0.03652405, 0.24328028, - - 0.06217413, 0.02201481, 0.00689594, 0.01944171, 0.09399488, - 0.02028993, 0.00738604, 0.03026811, 0.00960958, 0.08420492, - 0.10914991, 0.05364435, 0.07748005, 0.02937079, 0.0095028, - 0.00419387, 0.03018442, 0.01143929, 0.2511977, 0.06755678, - - 0.00587593, 0.04548053, 0.0346656, 0.02252594, 0.03742775, - 0.04219705, 0.00173478, 0.00571623, 0.2818174, 0.06557446, - 0.00763582, 0.03321466, 0.01962049, 0.03930537, 0.01254255, - 0.01246025, 0.02449929, 0.02939305, 0.15432668, 0.12398617}); + {0.22757064f, 0.00868076f, 0.03277484f, 0.00773243f, 0.0055188f, + 0.0178066f, 0.05756383f, 0.04745709f, 0.11716303f, 0.01392945f, + 0.00657097f, 0.10587974f, 0.01506727f, 0.01077484f, 0.00817884f, + 0.00406413f, 0.00776921f, 0.0256932f, 0.03652405f, 0.24328028f, + + 0.06217413f, 0.02201481f, 0.00689594f, 0.01944171f, 0.09399488f, + 0.02028993f, 0.00738604f, 0.03026811f, 0.00960958f, 0.08420492f, + 0.10914991f, 0.05364435f, 0.07748005f, 0.02937079f, 0.0095028f, + 0.00419387f, 0.03018442f, 0.01143929f, 0.2511977f, 0.06755678f, + + 0.00587593f, 0.04548053f, 0.0346656f, 0.02252594f, 0.03742775f, + 0.04219705f, 0.00173478f, 0.00571623f, 0.2818174f, 0.06557446f, + 0.00763582f, 0.03321466f, 0.01962049f, 0.03930537f, 0.01254255f, + 0.01246025f, 0.02449929f, 0.02939305f, 0.15432668f, 0.12398617f}); // clang-format on test_case.run(4); @@ -890,20 +890,20 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_softmax_axis_1_opset11) { // clang-format off test_case.add_expected_output( Shape{3, 4, 5}, - {0.88890495, 0.04825497, 0.27088348, 0.04490523, 0.02037154, - 0.06955369, 0.31998834, 0.39223197, 0.68041159, 0.05141776, - 0.02566661, 0.5885689, 0.12453075, 0.06257374, 0.03019055, - 0.01587475, 0.0431878, 0.21235381, 0.21210944, 0.89802015, - - 0.31752626, 0.19442629, 0.0546935, 0.06279221, 0.36823282, - 0.10362164, 0.06523066, 0.24006419, 0.03103672, 0.32987983, - 0.55743381, 0.473766, 0.61451431, 0.09486084, 0.03722801, - 0.02141829, 0.26657706, 0.090728, 0.81131024, 0.26465935, - - 0.08619648, 0.43343993, 0.3877785, 0.04523505, 0.15625437, - 0.61900597, 0.01653285, 0.06394322, 0.56592636, 0.27376196, - 0.11201305, 0.31654337, 0.21947994, 0.07893034, 0.05236297, - 0.18278451, 0.23348385, 0.32879834, 0.30990825, 0.5176207}); + {0.88890495f, 0.04825497f, 0.27088348f, 0.04490523f, 0.02037154f, + 0.06955369f, 0.31998834f, 0.39223197f, 0.68041159f, 0.05141776f, + 0.02566661f, 0.5885689f, 0.12453075f, 0.06257374f, 0.03019055f, + 0.01587475f, 0.0431878f, 0.21235381f, 0.21210944f, 0.89802015f, + + 0.31752626f, 0.19442629f, 0.0546935f, 0.06279221f, 0.36823282f, + 0.10362164f, 0.06523066f, 0.24006419f, 0.03103672f, 0.32987983f, + 0.55743381f, 0.473766f, 0.61451431f, 0.09486084f, 0.03722801f, + 0.02141829f, 0.26657706f, 0.090728f, 0.81131024f, 0.26465935f, + + 0.08619648f, 0.43343993f, 0.3877785f, 0.04523505f, 0.15625437f, + 0.61900597f, 0.01653285f, 0.06394322f, 0.56592636f, 0.27376196f, + 0.11201305f, 0.31654337f, 0.21947994f, 0.07893034f, 0.05236297f, + 0.18278451f, 0.23348385f, 0.32879834f, 0.30990825f, 0.5176207f}); // clang-format on test_case.run(4); @@ -920,20 +920,20 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_softmax_axis_negative_1_opset11) { // clang-format off test_case.add_expected_output( Shape{3, 4, 5}, - {0.80619484, 0.03075256, 0.1161086, 0.027393, 0.01955098, - 0.07012683, 0.22670066, 0.18689778, 0.4614171, 0.05485764, - 0.04486171, 0.7228683, 0.10286818, 0.07356264, 0.05583908, - 0.01280724, 0.02448298, 0.08096659, 0.11509769, 0.76664555, - - 0.30399805, 0.10764059, 0.03371745, 0.09505949, 0.4595844, - 0.13369875, 0.04866969, 0.19944906, 0.0633215, 0.554861, - 0.39101103, 0.19217177, 0.27755913, 0.10521588, 0.03404216, - 0.01150354, 0.08279411, 0.03137731, 0.6890207, 0.18530433, - - 0.0402528, 0.31156224, 0.23747502, 0.15431291, 0.25639707, - 0.10627912, 0.00436928, 0.01439711, 0.7097961, 0.16515835, - 0.06798343, 0.29571748, 0.17468554, 0.34994435, 0.11166911, - 0.03615172, 0.07108136, 0.08527993, 0.4477579, 0.35972902}); + {0.80619484f, 0.03075256f, 0.1161086f, 0.027393f, 0.01955098f, + 0.07012683f, 0.22670066f, 0.18689778f, 0.4614171f, 0.05485764f, + 0.04486171f, 0.7228683f, 0.10286818f, 0.07356264f, 0.05583908f, + 0.01280724f, 0.02448298f, 0.08096659f, 0.11509769f, 0.76664555f, + + 0.30399805f, 0.10764059f, 0.03371745f, 0.09505949f, 0.4595844f, + 0.13369875f, 0.04866969f, 0.19944906f, 0.0633215f, 0.554861f, + 0.39101103f, 0.19217177f, 0.27755913f, 0.10521588f, 0.03404216f, + 0.01150354f, 0.08279411f, 0.03137731f, 0.6890207f, 0.18530433f, + + 0.0402528f, 0.31156224f, 0.23747502f, 0.15431291f, 0.25639707f, + 0.10627912f, 0.00436928f, 0.01439711f, 0.7097961f, 0.16515835f, + 0.06798343f, 0.29571748f, 0.17468554f, 0.34994435f, 0.11166911f, + 0.03615172f, 0.07108136f, 0.08527993f, 0.4477579f, 0.35972902f}); // clang-format on test_case.run(6); @@ -950,20 +950,20 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_softmax_axis_negative_1_opset13) { // clang-format off test_case.add_expected_output( Shape{3, 4, 5}, - {0.80619484, 0.03075256, 0.1161086, 0.027393, 0.01955098, - 0.07012683, 0.22670066, 0.18689778, 0.4614171, 0.05485764, - 0.04486171, 0.7228683, 0.10286818, 0.07356264, 0.05583908, - 0.01280724, 0.02448298, 0.08096659, 0.11509769, 0.76664555, - - 0.30399805, 0.10764059, 0.03371745, 0.09505949, 0.4595844, - 0.13369875, 0.04866969, 0.19944906, 0.0633215, 0.554861, - 0.39101103, 0.19217177, 0.27755913, 0.10521588, 0.03404216, - 0.01150354, 0.08279411, 0.03137731, 0.6890207, 0.18530433, - - 0.0402528, 0.31156224, 0.23747502, 0.15431291, 0.25639707, - 0.10627912, 0.00436928, 0.01439711, 0.7097961, 0.16515835, - 0.06798343, 0.29571748, 0.17468554, 0.34994435, 0.11166911, - 0.03615172, 0.07108136, 0.08527993, 0.4477579, 0.35972902}); + {0.80619484f, 0.03075256f, 0.1161086f, 0.027393f, 0.01955098f, + 0.07012683f, 0.22670066f, 0.18689778f, 0.4614171f, 0.05485764f, + 0.04486171f, 0.7228683f, 0.10286818f, 0.07356264f, 0.05583908f, + 0.01280724f, 0.02448298f, 0.08096659f, 0.11509769f, 0.76664555f, + + 0.30399805f, 0.10764059f, 0.03371745f, 0.09505949f, 0.4595844f, + 0.13369875f, 0.04866969f, 0.19944906f, 0.0633215f, 0.554861f, + 0.39101103f, 0.19217177f, 0.27755913f, 0.10521588f, 0.03404216f, + 0.01150354f, 0.08279411f, 0.03137731f, 0.6890207f, 0.18530433f, + + 0.0402528f, 0.31156224f, 0.23747502f, 0.15431291f, 0.25639707f, + 0.10627912f, 0.00436928f, 0.01439711f, 0.7097961f, 0.16515835f, + 0.06798343f, 0.29571748f, 0.17468554f, 0.34994435f, 0.11166911f, + 0.03615172f, 0.07108136f, 0.08527993f, 0.4477579f, 0.35972902f}); // clang-format on test_case.run(6); @@ -2426,19 +2426,19 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_softplus) { -FLT_MAX}}; const auto inf = std::numeric_limits::infinity(); - std::vector output{0.3132616579532623291, - 0.6931471824645996094, - 1.313261628150939941, - 10.0000457763671875, - 100.0, - 0.0, - 1000.0, - 0.0, - 0.6931471824645996094, - 0.6931471824645996094, - 0.6931471824645996094, + std::vector output{0.3132616579532623291f, + 0.6931471824645996094f, + 1.313261628150939941f, + 10.0000457763671875f, + 100.0f, + 0.0f, + 1000.0f, + 0.0f, + 0.6931471824645996094f, + 0.6931471824645996094f, + 0.6931471824645996094f, inf, - 0.0}; + 0.0f}; auto test_case = test::TestCase(function, s_device); test_case.add_multiple_inputs(inputs); @@ -2736,10 +2736,11 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_one_hot_with_axis) { auto function = onnx_import::import_onnx_model( file_util::path_join(CommonTestUtils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/one_hot_axis.onnx")); - Inputs inputs{{1.0, 9.0, 2.0, 4.0}, {1.0, 3.0}}; - std::vector expected_output{{1.0, 1.0, 3.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, - 1.0, 1.0, 1.0, 1.0, 1.0, 3.0, 1.0, 1.0, 1.0, 1.0, 3.0, 1.0, 1.0, 1.0, - 1.0, 3.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0}}; + Inputs inputs{{1.0f, 9.0f, 2.0f, 4.0f}, {1.0f, 3.0f}}; + std::vector expected_output{{1.0f, 1.0f, 3.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, + 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 3.0f, + 1.0f, 1.0f, 1.0f, 1.0f, 3.0f, 1.0f, 1.0f, 1.0f, 1.0f, 3.0f, + 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f}}; auto test_case = test::TestCase(function, s_device); test_case.add_multiple_inputs(inputs); @@ -2953,7 +2954,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_instance_normalization_dynamic) { std::vector input_data{1.f, 2.f, 3.f}; test_case.add_input(Shape{1, 3, 1, 1}, input_data); test_case.add_expected_output(Shape{1, 3, 1, 1}, - {0.3341970741748809814, 0.3321160078048706055, 0.3407136797904968262}); + {0.3341970741748809814f, 0.3321160078048706055f, 0.3407136797904968262f}); test_case.run(); } @@ -3123,7 +3124,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_mod_sign_fmod_f32) { test_case.add_input({-4.3, 7.2, 5.0, 4.3, -7.2, 8.0}); test_case.add_input({2.1, -3.4, 8.0, -2.1, 3.4, 5.0}); - test_case.add_expected_output(Shape{6}, {-0.10000038, 0.39999962, 5., 0.10000038, -0.39999962, 3.}); + test_case.add_expected_output(Shape{6}, {-0.10000038f, 0.39999962f, 5.f, 0.10000038f, -0.39999962f, 3.f}); test_case.run(); } @@ -3280,22 +3281,22 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_gather_float_2D_neg_indices) { // clang-format off test_case.add_input(Shape{3, 3}, - { 0.0, 0.1, 0.2, - 1.0, 1.1, 1.2, - 2.0, 2.1, 2.2 }); + { 0.0f, 0.1f, 0.2f, + 1.0f, 1.1f, 1.2f, + 2.0f, 2.1f, 2.2f }); test_case.add_input(Shape{2, 2}, { -1, -2, -3, -2 }); test_case.add_expected_output(Shape{3, 2, 2}, { - 0.2, 0.1, - 0.0, 0.1, + 0.2f, 0.1f, + 0.0f, 0.1f, - 1.2, 1.1, - 1.0, 1.1, + 1.2f, 1.1f, + 1.0f, 1.1f, - 2.2, 2.1, - 2.0, 2.1 }); + 2.2f, 2.1f, + 2.0f, 2.1f }); // clang-format on test_case.run(); @@ -3633,10 +3634,10 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_upsample8_nearest_infer) { const Shape expected_output_shape{1, 1, 4, 6}; auto test_case = test::TestCase(function, s_device); - test_case.add_input({1.0, 2.0, 3.0, 4.0}); + test_case.add_input({1.0f, 2.0f, 3.0f, 4.0f}); test_case.add_expected_output(expected_output_shape, - {1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, - 3.0, 3.0, 3.0, 4.0, 4.0, 4.0, 3.0, 3.0, 3.0, 4.0, 4.0, 4.0}); + {1.0f, 1.0f, 1.0f, 2.0f, 2.0f, 2.0f, 1.0f, 1.0f, 1.0f, 2.0f, 2.0f, 2.0f, + 3.0f, 3.0f, 3.0f, 4.0f, 4.0f, 4.0f, 3.0f, 3.0f, 3.0f, 4.0f, 4.0f, 4.0f}); test_case.run(); } @@ -3650,10 +3651,10 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_upsample8_linear_infer) { const Shape expected_output_shape{1, 1, 4, 4}; auto test_case = test::TestCase(function, s_device); - test_case.add_input({1.0, 2.0, 3.0, 4.0}); + test_case.add_input({1.0f, 2.0f, 3.0f, 4.0f}); test_case.add_expected_output( expected_output_shape, - {1.0, 1.5, 2.0, 2.0, 2.0, 2.5, 3.0, 3.0, 3.0, 3.5, 4.0, 4.0, 3.0, 3.5, 4.0, 4.0}); + {1.0f, 1.5f, 2.0f, 2.0f, 2.0f, 2.5f, 3.0f, 3.0f, 3.0f, 3.5f, 4.0f, 4.0f, 3.0f, 3.5f, 4.0f, 4.0f}); test_case.run(); } @@ -3669,10 +3670,10 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_upsample9_scales_const_nearest_infer) { const Shape expected_output_shape{1, 1, 4, 6}; auto test_case = test::TestCase(function, s_device); - test_case.add_input({1.0, 2.0, 3.0, 4.0}); + test_case.add_input({1.0f, 2.0f, 3.0f, 4.0f}); test_case.add_expected_output(expected_output_shape, - {1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, - 3.0, 3.0, 3.0, 4.0, 4.0, 4.0, 3.0, 3.0, 3.0, 4.0, 4.0, 4.0}); + {1.0f, 1.0f, 1.0f, 2.0f, 2.0f, 2.0f, 1.0f, 1.0f, 1.0f, 2.0f, 2.0f, 2.0f, + 3.0f, 3.0f, 3.0f, 4.0f, 4.0f, 4.0f, 3.0f, 3.0f, 3.0f, 4.0f, 4.0f, 4.0f}); test_case.run(); } @@ -3688,10 +3689,10 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_upsample9_scales_const_linear_infer) { const Shape expected_output_shape{1, 1, 4, 4}; auto test_case = test::TestCase(function, s_device); - test_case.add_input({1.0, 2.0, 3.0, 4.0}); + test_case.add_input({1.0f, 2.0f, 3.0f, 4.0f}); test_case.add_expected_output( expected_output_shape, - {1.0, 1.5, 2.0, 2.0, 2.0, 2.5, 3.0, 3.0, 3.0, 3.5, 4.0, 4.0, 3.0, 3.5, 4.0, 4.0}); + {1.0f, 1.5f, 2.0f, 2.0f, 2.0f, 2.5f, 3.0f, 3.0f, 3.0f, 3.5f, 4.0f, 4.0f, 3.0f, 3.5f, 4.0f, 4.0f}); test_case.run(); } @@ -3700,8 +3701,8 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_image_scaler) { file_util::path_join(CommonTestUtils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/image_scaler.onnx")); auto test_case = test::TestCase(function, s_device); - test_case.add_input({1.0, 2.0, 3.0, 4.0, 10.0, 20.0, 30.0, 40.0}); - test_case.add_expected_output(Shape{1, 2, 2, 2}, {12.0, 14.0, 16.0, 18.0, 21.0, 41.0, 61.0, 81.0}); + test_case.add_input({1.0f, 2.0f, 3.0f, 4.0f, 10.0f, 20.0f, 30.0f, 40.0f}); + test_case.add_expected_output(Shape{1, 2, 2, 2}, {12.0f, 14.0f, 16.0f, 18.0f, 21.0f, 41.0f, 61.0f, 81.0f}); test_case.run(); } @@ -3710,7 +3711,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_size_op_single) { file_util::path_join(CommonTestUtils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/size_op_single.onnx")); auto test_case = test::TestCase(function, s_device); - test_case.add_input(Shape{2, 3}, {1.0, 2.0, 3.0, 4.0, 5.0, 6.0}); + test_case.add_input(Shape{2, 3}, {1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}); test_case.add_expected_output(Shape{}, {6}); test_case.run(); } @@ -3720,7 +3721,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_size_op_graph_end) { file_util::path_join(CommonTestUtils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/size_op_graph_end.onnx")); auto test_case = test::TestCase(function, s_device); - test_case.add_input({1.0, 2.0, 3.0, 4.0}); + test_case.add_input({1.0f, 2.0f, 3.0f, 4.0f}); test_case.add_expected_output(Shape{}, {4}); test_case.run(); } @@ -3731,8 +3732,8 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_size_op_graph_middle) { "onnx/size_op_graph_middle.onnx")); auto test_case = test::TestCase(function, s_device); - test_case.add_input({1.0, 2.0, 3.0, 4.0}); - test_case.add_expected_output(Shape{}, {4.0}); + test_case.add_input({1.0f, 2.0f, 3.0f, 4.0f}); + test_case.add_expected_output(Shape{}, {4.0f}); test_case.run(); } @@ -3743,11 +3744,11 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_size_op_on_input_graph_middle) { "onnx/size_op_on_input_graph_middle.onnx")); auto test_case = test::TestCase(function, s_device); - test_case.add_input(Shape{1, 2, 4, 1, 3}, {0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., - 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.}); + test_case.add_input(Shape{1, 2, 4, 1, 3}, {0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, + 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f}); test_case.add_expected_output(Shape{1, 2, 4, 1, 3}, - {24., 24., 24., 24., 24., 24., 24., 24., 24., 24., 24., 24., - 24., 24., 24., 24., 24., 24., 24., 24., 24., 24., 24., 24.}); + {24.f, 24.f, 24.f, 24.f, 24.f, 24.f, 24.f, 24.f, 24.f, 24.f, 24.f, 24.f, + 24.f, 24.f, 24.f, 24.f, 24.f, 24.f, 24.f, 24.f, 24.f, 24.f, 24.f, 24.f}); test_case.run(); } @@ -3818,36 +3819,39 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_roialign16_avg_out_half_pixel) { auto test_case = test::TestCase(function, s_device); test_case.add_input( - {1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8, 9.9, 11., 12.1, 13.2, 14.3, 15.4, 16.5, 17.6, - 18.7, 19.8, 20.9, 22., 23.1, 24.2, 25.3, 26.4, 27.5, 28.6, 29.7, 30.8, 31.9, 33., 34.1, 35.2, - 36.3, 37.4, 38.5, 39.6, 40.7, 41.8, 42.9, 44., 45.1, 46.2, 47.3, 48.4, 49.5, 50.6, 51.7, 52.8, - 53.9, 55., 56.1, 57.2, 58.3, 59.4, 60.5, 61.6, 62.7, 63.8, 64.9, 66., 67.1, 68.2, 69.3, 70.4, - 71.5, 72.6, 73.7, 74.8, 75.9, 77., 78.1, 79.2, 80.3, 81.4, 82.5, 83.6, 84.7, 85.8, 86.9, 88., - 89.1, 90.2, 91.3, 92.4, 93.5, 94.6, 95.7, 96.8, 97.9, 99., 100.1, 101.2, 102.3, 103.4, 104.5, 105.6, - 106.7, 107.8, 108.9, 110., 111.1, 112.2, 113.3, 114.4, 115.5, 116.6, 117.7, 118.8, 119.9, 121., 122.1, 123.2, - 124.3, 125.4, 126.5, 127.6, 128.7, 129.8, 130.9, 132., 133.1, 134.2, 135.3, 136.4, 137.5, 138.6, 139.7, 140.8, - 141.9, 143., 144.1, 145.2, 146.3, 147.4, 148.5, 149.6, 150.7, 151.8, 152.9, 154., 155.1, 156.2, 157.3, 158.4, - 159.5, 160.6, 161.7, 162.8, 163.9, 165., 166.1, 167.2, 168.3, 169.4, 170.5, 171.6, 172.7, 173.8, 174.9, 176., - 177.1, 178.2, 179.3, 180.4, 181.5, 182.6, 183.7, 184.8, 185.9, 187., 188.1, 189.2, 190.3, 191.4, 192.5, 193.6, - 194.7, 195.8, 196.9, 198., 199.1, 200.2, 201.3, 202.4, 203.5, 204.6, 205.7, 206.8, 207.9, 209., 210.1, 211.2, - 212.3, 213.4, 214.5, 215.6, 216.7, 217.8, 218.9, 220., 221.1, 222.2, 223.3, 224.4, 225.5, 226.6, 227.7, 228.8, - 229.9, 231., 232.1, 233.2, 234.3, 235.4, 236.5, 237.6}); - - test_case.add_input({0, 0, 0.75, 2.2, 1.2, 0.5, 2.8, 1.9, 0, 3, 0, 3}); + {1.1f, 2.2f, 3.3f, 4.4f, 5.5f, 6.6f, 7.7f, 8.8f, 9.9f, 11.f, 12.1f, 13.2f, 14.3f, 15.4f, + 16.5f, 17.6f, 18.7f, 19.8f, 20.9f, 22.f, 23.1f, 24.2f, 25.3f, 26.4f, 27.5f, 28.6f, 29.7f, 30.8f, + 31.9f, 33.f, 34.1f, 35.2f, 36.3f, 37.4f, 38.5f, 39.6f, 40.7f, 41.8f, 42.9f, 44.f, 45.1f, 46.2f, + 47.3f, 48.4f, 49.5f, 50.6f, 51.7f, 52.8f, 53.9f, 55.f, 56.1f, 57.2f, 58.3f, 59.4f, 60.5f, 61.6f, + 62.7f, 63.8f, 64.9f, 66.f, 67.1f, 68.2f, 69.3f, 70.4f, 71.5f, 72.6f, 73.7f, 74.8f, 75.9f, 77.f, + 78.1f, 79.2f, 80.3f, 81.4f, 82.5f, 83.6f, 84.7f, 85.8f, 86.9f, 88.f, 89.1f, 90.2f, 91.3f, 92.4f, + 93.5f, 94.6f, 95.7f, 96.8f, 97.9f, 99.f, 100.1f, 101.2f, 102.3f, 103.4f, 104.5f, 105.6f, 106.7f, 107.8f, + 108.9f, 110.f, 111.1f, 112.2f, 113.3f, 114.4f, 115.5f, 116.6f, 117.7f, 118.8f, 119.9f, 121.f, 122.1f, 123.2f, + 124.3f, 125.4f, 126.5f, 127.6f, 128.7f, 129.8f, 130.9f, 132.f, 133.1f, 134.2f, 135.3f, 136.4f, 137.5f, 138.6f, + 139.7f, 140.8f, 141.9f, 143.f, 144.1f, 145.2f, 146.3f, 147.4f, 148.5f, 149.6f, 150.7f, 151.8f, 152.9f, 154.f, + 155.1f, 156.2f, 157.3f, 158.4f, 159.5f, 160.6f, 161.7f, 162.8f, 163.9f, 165.f, 166.1f, 167.2f, 168.3f, 169.4f, + 170.5f, 171.6f, 172.7f, 173.8f, 174.9f, 176.f, 177.1f, 178.2f, 179.3f, 180.4f, 181.5f, 182.6f, 183.7f, 184.8f, + 185.9f, 187.f, 188.1f, 189.2f, 190.3f, 191.4f, 192.5f, 193.6f, 194.7f, 195.8f, 196.9f, 198.f, 199.1f, 200.2f, + 201.3f, 202.4f, 203.5f, 204.6f, 205.7f, 206.8f, 207.9f, 209.f, 210.1f, 211.2f, 212.3f, 213.4f, 214.5f, 215.6f, + 216.7f, 217.8f, 218.9f, 220.f, 221.1f, 222.2f, 223.3f, 224.4f, 225.5f, 226.6f, 227.7f, 228.8f, 229.9f, 231.f, + 232.1f, 233.2f, 234.3f, 235.4f, 236.5f, 237.6f}); + + test_case.add_input({0.f, 0.f, 0.75f, 2.2f, 1.2f, 0.5f, 2.8f, 1.9f, 0.f, 3.f, 0.f, 3.f}); test_case.add_input({0, 2, 1}); test_case.add_expected_output( Shape{3, 2, 4, 4}, - {2.145, 2.42, 2.6950002, 2.9700003, 3.96, 4.235, 4.51, 4.7850003, 5.775, 6.05, - 6.325, 6.6000004, 7.59, 7.8650007, 8.14, 8.415001, 41.745003, 42.019997, 42.295, 42.57, - 43.56, 43.835, 44.11, 44.385002, 45.375, 45.65, 45.925003, 46.200005, 47.190002, 47.465004, - 47.74, 48.015, 162.77249, 163.0475, 163.32251, 163.5975, 164.42252, 164.69751, 164.9725, 165.2475, - 166.07251, 166.3475, 166.6225, 166.8975, 167.72249, 167.9975, 168.27249, 168.5475, 202.3725, 202.6475, - 202.9225, 203.19751, 204.02252, 204.2975, 204.57251, 204.8475, 205.6725, 205.94751, 206.2225, 206.4975, - 207.32251, 207.5975, 207.8725, 208.1475, 91.162506, 91.4375, 91.7125, 91.9875, 92.8125, 93.0875, - 93.3625, 93.6375, 94.4625, 94.7375, 95.0125, 95.28749, 96.1125, 96.3875, 96.6625, 96.9375, - 130.76251, 131.0375, 131.3125, 131.5875, 132.4125, 132.6875, 132.9625, 133.2375, 134.0625, 134.33751, - 134.6125, 134.88751, 135.7125, 135.9875, 136.26251, 136.53749}); + {2.145f, 2.42f, 2.6950002f, 2.9700003f, 3.96f, 4.235f, 4.51f, 4.7850003f, 5.775f, + 6.05f, 6.325f, 6.6000004f, 7.59f, 7.8650007f, 8.14f, 8.415001f, 41.745003f, 42.019997f, + 42.295f, 42.57f, 43.56f, 43.835f, 44.11f, 44.385002f, 45.375f, 45.65f, 45.925003f, + 46.200005f, 47.190002f, 47.465004f, 47.74f, 48.015f, 162.77249f, 163.0475f, 163.32251f, 163.5975f, + 164.42252f, 164.69751f, 164.9725f, 165.2475f, 166.07251f, 166.3475f, 166.6225f, 166.8975f, 167.72249f, + 167.9975f, 168.27249f, 168.5475f, 202.3725f, 202.6475f, 202.9225f, 203.19751f, 204.02252f, 204.2975f, + 204.57251f, 204.8475f, 205.6725f, 205.94751f, 206.2225f, 206.4975f, 207.32251f, 207.5975f, 207.8725f, + 208.1475f, 91.162506f, 91.4375f, 91.7125f, 91.9875f, 92.8125f, 93.0875f, 93.3625f, 93.6375f, + 94.4625f, 94.7375f, 95.0125f, 95.28749f, 96.1125f, 96.3875f, 96.6625f, 96.9375f, 130.76251f, + 131.0375f, 131.3125f, 131.5875f, 132.4125f, 132.6875f, 132.9625f, 133.2375f, 134.0625f, 134.33751f, + 134.6125f, 134.88751f, 135.7125f, 135.9875f, 136.26251f, 136.53749f}); test_case.run(); } @@ -3858,36 +3862,40 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_roialign16_avg_half_pixel) { auto test_case = test::TestCase(function, s_device); test_case.add_input( - {1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8, 9.9, 11., 12.1, 13.2, 14.3, 15.4, 16.5, 17.6, - 18.7, 19.8, 20.9, 22., 23.1, 24.2, 25.3, 26.4, 27.5, 28.6, 29.7, 30.8, 31.9, 33., 34.1, 35.2, - 36.3, 37.4, 38.5, 39.6, 40.7, 41.8, 42.9, 44., 45.1, 46.2, 47.3, 48.4, 49.5, 50.6, 51.7, 52.8, - 53.9, 55., 56.1, 57.2, 58.3, 59.4, 60.5, 61.6, 62.7, 63.8, 64.9, 66., 67.1, 68.2, 69.3, 70.4, - 71.5, 72.6, 73.7, 74.8, 75.9, 77., 78.1, 79.2, 80.3, 81.4, 82.5, 83.6, 84.7, 85.8, 86.9, 88., - 89.1, 90.2, 91.3, 92.4, 93.5, 94.6, 95.7, 96.8, 97.9, 99., 100.1, 101.2, 102.3, 103.4, 104.5, 105.6, - 106.7, 107.8, 108.9, 110., 111.1, 112.2, 113.3, 114.4, 115.5, 116.6, 117.7, 118.8, 119.9, 121., 122.1, 123.2, - 124.3, 125.4, 126.5, 127.6, 128.7, 129.8, 130.9, 132., 133.1, 134.2, 135.3, 136.4, 137.5, 138.6, 139.7, 140.8, - 141.9, 143., 144.1, 145.2, 146.3, 147.4, 148.5, 149.6, 150.7, 151.8, 152.9, 154., 155.1, 156.2, 157.3, 158.4, - 159.5, 160.6, 161.7, 162.8, 163.9, 165., 166.1, 167.2, 168.3, 169.4, 170.5, 171.6, 172.7, 173.8, 174.9, 176., - 177.1, 178.2, 179.3, 180.4, 181.5, 182.6, 183.7, 184.8, 185.9, 187., 188.1, 189.2, 190.3, 191.4, 192.5, 193.6, - 194.7, 195.8, 196.9, 198., 199.1, 200.2, 201.3, 202.4, 203.5, 204.6, 205.7, 206.8, 207.9, 209., 210.1, 211.2, - 212.3, 213.4, 214.5, 215.6, 216.7, 217.8, 218.9, 220., 221.1, 222.2, 223.3, 224.4, 225.5, 226.6, 227.7, 228.8, - 229.9, 231., 232.1, 233.2, 234.3, 235.4, 236.5, 237.6}); - - test_case.add_input({0, 0, 0.75, 2.2, 1.2, 0.5, 2.8, 1.9, 0, 3, 0, 3}); + {1.1f, 2.2f, 3.3f, 4.4f, 5.5f, 6.6f, 7.7f, 8.8f, 9.9f, 11.f, 12.1f, 13.2f, 14.3f, + 15.4f, 16.5f, 17.6f, 18.7f, 19.8f, 20.9f, 22.f, 23.1f, 24.2f, 25.3f, 26.4f, 27.5f, 28.6f, + 29.7f, 30.8f, 31.9f, 33.f, 34.1f, 35.2f, 36.3f, 37.4f, 38.5f, 39.6f, 40.7f, 41.8f, 42.9f, + 44.f, 45.1f, 46.2f, 47.3f, 48.4f, 49.5f, 50.6f, 51.7f, 52.8f, 53.9f, 55.f, 56.1f, 57.2f, + 58.3f, 59.4f, 60.5f, 61.6f, 62.7f, 63.8f, 64.9f, 66.f, 67.1f, 68.2f, 69.3f, 70.4f, 71.5f, + 72.6f, 73.7f, 74.8f, 75.9f, 77.f, 78.1f, 79.2f, 80.3f, 81.4f, 82.5f, 83.6f, 84.7f, 85.8f, + 86.9f, 88.f, 89.1f, 90.2f, 91.3f, 92.4f, 93.5f, 94.6f, 95.7f, 96.8f, 97.9f, 99.f, 100.1f, + 101.2f, 102.3f, 103.4f, 104.5f, 105.6f, 106.7f, 107.8f, 108.9f, 110.f, 111.1f, 112.2f, 113.3f, 114.4f, + 115.5f, 116.6f, 117.7f, 118.8f, 119.9f, 121.f, 122.1f, 123.2f, 124.3f, 125.4f, 126.5f, 127.6f, 128.7f, + 129.8f, 130.9f, 132.f, 133.1f, 134.2f, 135.3f, 136.4f, 137.5f, 138.6f, 139.7f, 140.8f, 141.9f, 143.f, + 144.1f, 145.2f, 146.3f, 147.4f, 148.5f, 149.6f, 150.7f, 151.8f, 152.9f, 154.f, 155.1f, 156.2f, 157.3f, + 158.4f, 159.5f, 160.6f, 161.7f, 162.8f, 163.9f, 165.f, 166.1f, 167.2f, 168.3f, 169.4f, 170.5f, 171.6f, + 172.7f, 173.8f, 174.9f, 176.f, 177.1f, 178.2f, 179.3f, 180.4f, 181.5f, 182.6f, 183.7f, 184.8f, 185.9f, + 187.198f, 188.1f, 189.2f, 190.3f, 191.4f, 192.5f, 193.6f, 194.7f, 195.8f, 196.9f, 198.f, 199.1f, 200.2f, + 201.3f, 202.4f, 203.5f, 204.6f, 205.7f, 206.8f, 207.9f, 209.f, 210.1f, 211.2f, 212.3f, 213.4f, 214.5f, + 215.6f, 216.7f, 217.8f, 218.9f, 220.f, 221.1f, 222.2f, 223.3f, 224.4f, 225.5f, 226.6f, 227.7f, 228.8f, + 229.9f, 231.f, 232.1f, 233.2f, 234.3f, 235.4f, 236.5f, 237.6f}); + + test_case.add_input({0.f, 0.f, 0.75f, 2.2f, 1.2f, 0.5f, 2.8f, 1.9f, 0.f, 3.f, 0.f, 3.f}); test_case.add_input({0, 2, 1}); test_case.add_expected_output( Shape{3, 2, 4, 4}, - {1.1, 1.1, 1.1, 1.1, 1.1, 1.1, 1.1, 1.1, 2.3375, 2.3375, - 2.3375, 2.3375, 4.1525, 4.1525, 4.1525, 4.1525, 40.7, 40.7, 40.7, 40.7, - 40.7, 40.7, 40.7, 40.7, 41.9375, 41.9375, 41.9375, 41.9375, 43.7525, 43.7525, - 43.7525, 43.7525, 159.72, 159.94, 160.16, 160.38, 159.90562, 160.12563, 160.34563, 160.56563, - 160.9575, 161.1775, 161.3975, 161.61751, 162.1125, 162.3325, 162.55249, 162.77249, 199.32, 199.54001, - 199.76001, 199.97998, 199.50562, 199.72563, 199.94562, 200.16562, 200.5575, 200.7775, 200.9975, 201.2175, - 201.7125, 201.93251, 202.1525, 202.37251, 86.9, 86.9, 86.9, 86.9, 86.9, 86.9, - 86.9, 86.9, 86.9, 86.9, 86.9, 86.9, 86.9, 86.9, 86.9, 86.9, - 126.5, 126.5, 126.5, 126.5, 126.5, 126.5, 126.5, 126.5, 126.5, 126.5, - 126.5, 126.5, 126.5, 126.5, 126.5, 126.5}); + {1.1f, 1.1f, 1.1f, 1.1f, 1.1f, 1.1f, 1.1f, 1.1f, 2.3375f, + 2.3375f, 2.3375f, 2.3375f, 4.1525f, 4.1525f, 4.1525f, 4.1525f, 40.7f, 40.7f, + 40.7f, 40.7f, 40.7f, 40.7f, 40.7f, 40.7f, 41.9375f, 41.9375f, 41.9375f, + 41.9375f, 43.7525f, 43.7525f, 43.7525f, 43.7525f, 159.72f, 159.94f, 160.16f, 160.38f, + 159.90562f, 160.12563f, 160.34563f, 160.56563f, 160.9575f, 161.1775f, 161.3975f, 161.61751f, 162.1125f, + 162.3325f, 162.55249f, 162.77249f, 199.32f, 199.54001f, 199.76001f, 199.97998f, 199.50562f, 199.72563f, + 199.94562f, 200.16562f, 200.5575f, 200.7775f, 200.9975f, 201.2175f, 201.7125f, 201.93251f, 202.1525f, + 202.37251f, 86.9f, 86.9f, 86.9f, 86.9f, 86.9f, 86.9f, 86.9f, 86.9f, + 86.9f, 86.9f, 86.9f, 86.9f, 86.9f, 86.9f, 86.9f, 86.9f, 126.5f, + 126.5f, 126.5f, 126.5f, 126.5f, 126.5f, 126.5f, 126.5f, 126.5f, 126.5f, + 126.5f, 126.5f, 126.5f, 126.5f, 126.5f, 126.5f}); test_case.run_with_tolerance_as_fp(0.01f); } @@ -3898,9 +3906,9 @@ NGRAPH_TEST(${BACKEND_NAME}, quant_dequant_pattern) { auto test_case = test::TestCase(function, s_device); // scale == 3.0 // zero point == 10 - test_case.add_input({9.0, 10.0, 15.0, 20.0, 30.0}); - test_case.add_input({1}); - test_case.add_expected_output(Shape{5}, {9.0, 9.0, 15.0, 21.0, 30.0}); + test_case.add_input({9.0f, 10.0f, 15.0f, 20.0f, 30.0f}); + test_case.add_input({1.f}); + test_case.add_expected_output(Shape{5}, {9.0f, 9.0f, 15.0f, 21.0f, 30.0f}); test_case.run(); } @@ -3912,9 +3920,9 @@ NGRAPH_TEST(${BACKEND_NAME}, quant_dequant_pattern_axis) { // axis = 1 // scale == {2.0, 3.0, 4.0} // zero point == {10, 20, 30} - test_case.add_input({1.0, 2.0, 3.0, 10.0, 20.0, 30.0, 40.0, 50.0, 100.0}); - test_case.add_expected_output(Shape{3, 3}, {0, 3, 4, 10, 21, 32, 40, 51, 100}); - test_case.add_input({1}); + test_case.add_input({1.0f, 2.0f, 3.0f, 10.0f, 20.0f, 30.0f, 40.0f, 50.0f, 100.0f}); + test_case.add_expected_output(Shape{3, 3}, {0.f, 3.f, 4.f, 10.f, 21.f, 32.f, 40.f, 51.f, 100.f}); + test_case.add_input({1.f}); test_case.run(); } @@ -3923,8 +3931,8 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_logsoftmax_0D) { file_util::path_join(CommonTestUtils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/softmax_0D.onnx")); auto test_case = test::TestCase(function, s_device); - test_case.add_input({3.141592}); - test_case.add_expected_output({0.0}); + test_case.add_input({3.141592f}); + test_case.add_expected_output({0.0f}); test_case.run(); } @@ -3934,7 +3942,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_logsoftmax_1D) { auto test_case = test::TestCase(function, s_device); test_case.add_input({-1.0f, 0.0f, 1.0f}); - test_case.add_expected_output(Shape{3}, {-2.4076061, -1.407606, -0.407606}); + test_case.add_expected_output(Shape{3}, {-2.4076061f, -1.407606f, -0.407606f}); test_case.run(); } @@ -3944,7 +3952,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_logsoftmax13_1D) { auto test_case = test::TestCase(function, s_device); test_case.add_input({-1.0f, 0.0f, 1.0f}); - test_case.add_expected_output(Shape{3}, {-2.4076061, -1.407606, -0.407606}); + test_case.add_expected_output(Shape{3}, {-2.4076061f, -1.407606f, -0.407606f}); test_case.run(); } @@ -3953,10 +3961,10 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_logsoftmax13_2D) { file_util::path_join(CommonTestUtils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/logsoftmax13_2D.onnx")); auto test_case = test::TestCase(function, s_device); - test_case.add_input({0.0f, 1.0f, 2.0f, 3.0f, 10000, 10001, 10002, 10003}); + test_case.add_input({0.0f, 1.0f, 2.0f, 3.0f, 10000.f, 10001.f, 10002.f, 10003.f}); test_case.add_expected_output( Shape{2, 4}, - {-3.4401896, -2.4401896, -1.4401896, -0.44018966, -3.4401896, -2.4401896, -1.4401896, -0.44018966}); + {-3.4401896f, -2.4401896f, -1.4401896f, -0.44018966f, -3.4401896f, -2.4401896f, -1.4401896f, -0.44018966f}); test_case.run_with_tolerance_as_fp(); } @@ -4299,7 +4307,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_clip_no_min_no_max) { "onnx/clip_no_min_no_max.onnx")); auto test_case = test::TestCase(function, s_device); - const std::vector data{-1.6, -0.1, 10., 0., -10., 1.99, 2.015, 3.}; + const std::vector data{-1.6f, -0.1f, 10.f, 0.f, -10.f, 1.99f, 2.015f, 3.f}; test_case.add_input(data); @@ -4343,9 +4351,9 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_clip_no_min_set_max) { "onnx/clip_no_min_set_max.onnx")); auto test_case = test::TestCase(function, s_device); - const std::vector data{-1.6, -0.1, 10., 0., -10., 1.99, 2.015, 3.}; - const std::vector max_val{2.01}; - const std::vector output{-1.6, -0.1, 2.01, 0., -10., 1.99, 2.01, 2.01}; + const std::vector data{-1.6f, -0.1f, 10.f, 0.f, -10.f, 1.99f, 2.015f, 3.f}; + const std::vector max_val{2.01f}; + const std::vector output{-1.6f, -0.1f, 2.01f, 0.f, -10.f, 1.99f, 2.01f, 2.01f}; test_case.add_input(data); test_case.add_input(max_val); @@ -4360,9 +4368,9 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_clip_set_min_no_max) { "onnx/clip_set_min_no_max.onnx")); auto test_case = test::TestCase(function, s_device); - const std::vector data{-1.6, -0.1, 10., 0., -10., 1.99, 2.015, 3.}; - const std::vector min_val{-1.59}; - const std::vector output{-1.59, -0.1, 10., 0., -1.59, 1.99, 2.015, 3.}; + const std::vector data{-1.6f, -0.1f, 10.f, 0.f, -10.f, 1.99f, 2.015f, 3.f}; + const std::vector min_val{-1.59f}; + const std::vector output{-1.59f, -0.1f, 10.f, 0.f, -1.59f, 1.99f, 2.015f, 3.f}; test_case.add_input(data); test_case.add_input(min_val); @@ -4408,8 +4416,8 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_clip_set_min_no_max_initializers) { "onnx/clip_set_min_no_max_initializers.onnx")); auto test_case = test::TestCase(function, s_device); - const std::vector data{-1.6, -0.1, 10., 0., -10., 1.99, 2.015, 3.}; - const std::vector output{-1.59, -0.1, 10., 0., -1.59, 1.99, 2.015, 3.}; + const std::vector data{-1.6f, -0.1f, 10.f, 0.f, -10.f, 1.99f, 2.015f, 3.f}; + const std::vector output{-1.59f, -0.1f, 10.f, 0.f, -1.59f, 1.99f, 2.015f, 3.f}; test_case.add_input(data); @@ -4423,10 +4431,10 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_clip_set_min_set_max) { "onnx/clip_set_min_set_max.onnx")); auto test_case = test::TestCase(function, s_device); - const std::vector data{-1.6, -0.1, 10., 0., -10., 1.99, 2.015, 3.}; - const std::vector min_val{-1.59}; - const std::vector max_val{2.01}; - const std::vector output{-1.59, -0.1, 2.01, 0., -1.59, 1.99, 2.01, 2.01}; + const std::vector data{-1.6f, -0.1f, 10.f, 0.f, -10.f, 1.99f, 2.015f, 3.f}; + const std::vector min_val{-1.59f}; + const std::vector max_val{2.01f}; + const std::vector output{-1.59f, -0.1f, 2.01f, 0.f, -1.59f, 1.99f, 2.01f, 2.01f}; test_case.add_input(data); test_case.add_input(min_val); @@ -4442,8 +4450,8 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_clip_set_min_set_max_initializers) { "onnx/clip_set_min_set_max_initializers.onnx")); auto test_case = test::TestCase(function, s_device); - const std::vector data{-1.6, -0.1, 10., 0., -10., 1.99, 2.015, 3.}; - const std::vector output{-1.59, -0.1, 2.01, 0., -1.59, 1.99, 2.01, 2.01}; + const std::vector data{-1.6f, -0.1f, 10.f, 0.f, -10.f, 1.99f, 2.015f, 3.f}; + const std::vector output{-1.59f, -0.1f, 2.01f, 0.f, -1.59f, 1.99f, 2.01f, 2.01f}; test_case.add_input(data); @@ -4456,16 +4464,16 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_mvn_v6) { file_util::path_join(CommonTestUtils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/mvn_v6.onnx")); auto test_case = test::TestCase(function, s_device); - test_case.add_input({0.8439683, 0.5665144, 0.05836735, 0.02916367, 0.12964272, 0.5060197, 0.79538304, - 0.9411346, 0.9546573, 0.17730942, 0.46192095, 0.26480448, 0.6746842, 0.01665257, - 0.62473077, 0.9240844, 0.9722341, 0.11965699, 0.41356155, 0.9129373, 0.59330076, - 0.81929934, 0.7862604, 0.11799799, 0.69248444, 0.54119414, 0.07513223}); + test_case.add_input({0.8439683f, 0.5665144f, 0.05836735f, 0.02916367f, 0.12964272f, 0.5060197f, 0.79538304f, + 0.9411346f, 0.9546573f, 0.17730942f, 0.46192095f, 0.26480448f, 0.6746842f, 0.01665257f, + 0.62473077f, 0.9240844f, 0.9722341f, 0.11965699f, 0.41356155f, 0.9129373f, 0.59330076f, + 0.81929934f, 0.7862604f, 0.11799799f, 0.69248444f, 0.54119414f, 0.07513223f}); test_case.add_expected_output( Shape{3, 3, 3, 1}, - {1.3546423, 0.33053496, -1.5450814, -1.2106764, -0.8925952, 0.29888135, 0.38083088, - 0.81808794, 0.85865635, -1.1060555, -0.05552877, -0.78310335, 0.83281356, -1.250282, - 0.67467856, 0.7669372, 0.9113869, -1.6463585, -0.23402764, 1.6092131, 0.42940593, - 1.2906139, 1.1860244, -0.92945826, 0.0721334, -0.38174, -1.7799333}); + {1.3546423f, 0.33053496f, -1.5450814f, -1.2106764f, -0.8925952f, 0.29888135f, 0.38083088f, + 0.81808794f, 0.85865635f, -1.1060555f, -0.05552877f, -0.78310335f, 0.83281356f, -1.250282f, + 0.67467856f, 0.7669372f, 0.9113869f, -1.6463585f, -0.23402764f, 1.6092131f, 0.42940593f, + 1.2906139f, 1.1860244f, -0.92945826f, 0.0721334f, -0.38174f, -1.7799333f}); test_case.run(); } @@ -4613,23 +4621,23 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_softmax_crossentropy_loss_mean) { "onnx/softmax_crossentropy_loss_mean.onnx")); auto test_case = test::TestCase(function, s_device); - test_case.add_input({0.54881352186203, - 0.7151893377304077, - 0.6027633547782898, - 0.5448831915855408, - 0.42365479469299316, - 0.6458941102027893, - 0.4375872015953064, - 0.891772985458374, - 0.9636627435684204, - 0.3834415078163147, - 0.7917250394821167, - 0.5288949012756348, - 0.5680445432662964, - 0.9255966544151306, - 0.07103605568408966}); + test_case.add_input({0.54881352186203f, + 0.7151893377304077f, + 0.6027633547782898f, + 0.5448831915855408f, + 0.42365479469299316f, + 0.6458941102027893f, + 0.4375872015953064f, + 0.891772985458374f, + 0.9636627435684204f, + 0.3834415078163147f, + 0.7917250394821167f, + 0.5288949012756348f, + 0.5680445432662964f, + 0.9255966544151306f, + 0.07103605568408966f}); test_case.add_input({1, 4, 3}); - test_case.add_expected_output(Shape{}, {1.561384797096252441}); + test_case.add_expected_output(Shape{}, {1.561384797096252441f}); test_case.run(); } @@ -4640,15 +4648,15 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_negativelog_likelihood_loss) { auto test_case = test::TestCase(function, s_device); test_case.add_input({ - 0.54881352186203, 0.7151893377304077, 0.6027633547782898, 0.5448831915855408, 0.42365479469299316, - 0.6458941102027893, 0.4375872015953064, 0.891772985458374, 0.9636627435684204, 0.3834415078163147, - 0.7917250394821167, 0.5288949012756348, 0.5680445432662964, 0.9255966544151306, 0.07103605568408966, - 0.08712930232286453, 0.020218396559357643, 0.832619845867157, 0.7781567573547363, 0.8700121641159058, - 0.978618323802948, 0.7991585731506348, 0.4614793658256531, 0.7805292010307312, 0.11827442795038223, - 0.6399210095405579, 0.14335328340530396, 0.9446688890457153, 0.5218483209609985, 0.4146619439125061, + 0.54881352186203f, 0.7151893377304077f, 0.6027633547782898f, 0.5448831915855408f, 0.42365479469299316f, + 0.6458941102027893f, 0.4375872015953064f, 0.891772985458374f, 0.9636627435684204f, 0.3834415078163147f, + 0.7917250394821167f, 0.5288949012756348f, 0.5680445432662964f, 0.9255966544151306f, 0.07103605568408966f, + 0.08712930232286453f, 0.020218396559357643f, 0.832619845867157f, 0.7781567573547363f, 0.8700121641159058f, + 0.978618323802948f, 0.7991585731506348f, 0.4614793658256531f, 0.7805292010307312f, 0.11827442795038223f, + 0.6399210095405579f, 0.14335328340530396f, 0.9446688890457153f, 0.5218483209609985f, 0.4146619439125061f, }); test_case.add_input({3, 3, 2, 4, 2, 0}); - test_case.add_expected_output(Shape{}, {-0.531306922435760498}); + test_case.add_expected_output(Shape{}, {-0.531306922435760498f}); test_case.run(); } @@ -4958,19 +4966,19 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_einsum_sum) { file_util::path_join(CommonTestUtils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/einsum_sum.onnx")); auto test_case = test::TestCase(function, s_device); test_case.add_input(Shape{3, 4}, - {1.764052345967664, - 0.4001572083672233, - 0.9787379841057392, - 2.240893199201458, - 1.8675579901499675, - -0.977277879876411, - 0.9500884175255894, - -0.1513572082976979, - -0.10321885179355784, - 0.41059850193837233, - 0.144043571160878, - 1.454273506962975}); - test_case.add_expected_output(Shape{3}, {5.3838407376420845, 1.689011319501448, 1.9056967282686674}); + {1.764052345967664f, + 0.4001572083672233f, + 0.9787379841057392f, + 2.240893199201458f, + 1.8675579901499675f, + -0.977277879876411f, + 0.9500884175255894f, + -0.1513572082976979f, + -0.10321885179355784f, + 0.41059850193837233f, + 0.144043571160878f, + 1.454273506962975f}); + test_case.add_expected_output(Shape{3}, {5.3838407376420845f, 1.689011319501448f, 1.9056967282686674f}); test_case.run(); } @@ -5074,7 +5082,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_random_uniform) { file_util::path_join(CommonTestUtils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/random_uniform.onnx")); auto test_case = test::TestCase(function, s_device); - test_case.add_expected_output(Shape{2, 2}, {43.45518, 48.67585, 42.227386, 40.86294}); + test_case.add_expected_output(Shape{2, 2}, {43.45518f, 48.67585f, 42.227386f, 40.86294f}); test_case.run(); } @@ -5085,7 +5093,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_random_uniform_like) { auto test_case = test::TestCase(function, s_device); test_case.add_input(Shape{2, 2}, {41, 42, 43, 44}); - test_case.add_expected_output(Shape{2, 2}, {43.45518, 48.67585, 42.227386, 40.86294}); + test_case.add_expected_output(Shape{2, 2}, {43.45518f, 48.67585f, 42.227386f, 40.86294f}); test_case.run(); } @@ -5094,7 +5102,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_random_normal) { file_util::path_join(CommonTestUtils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/random_normal.onnx")); auto test_case = test::TestCase(function, s_device); - test_case.add_expected_output(Shape{2, 2}, {13.459274, 41.75028, -19.311913, 131.79282}); + test_case.add_expected_output(Shape{2, 2}, {13.459274f, 41.75028f, -19.311913f, 131.79282f}); test_case.run(); } @@ -5105,50 +5113,50 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_random_normal_like) { auto test_case = test::TestCase(function, s_device); test_case.add_input(Shape{2, 2}, {0, 0, 0, 0}); - test_case.add_expected_output(Shape{2, 2}, {13.459274, 41.75028, -19.311913, 131.79282}); + test_case.add_expected_output(Shape{2, 2}, {13.459274f, 41.75028f, -19.311913f, 131.79282f}); test_case.run(); } -NGRAPH_TEST(${BACKEND_NAME}, onnx_aten_embedding_bag_packed_sum_2in) { +NGRAPH_TEST(${BACKEND_NAME}, onnx_aten_embedding_bag_packed_sum_2fin) { const auto function = onnx_import::import_onnx_model(file_util::path_join(CommonTestUtils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/aten_embedding_sum_packed_2in.onnx")); auto test_case = test::TestCase(function, s_device); - test_case.add_input(Shape{5, 2}, {-0.2, -0.6, -0.1, -0.4, -1.9, -1.8, -1., 1.5, 0.8, -0.7}); + test_case.add_input(Shape{5, 2}, {-0.2f, -0.6f, -0.1f, -0.4f, -1.9f, -1.8f, -1.f, 1.5f, 0.8f, -0.7f}); test_case.add_input(Shape{3, 2}, {0, 2, 1, 2, 3, 4}); // indices - test_case.add_expected_output(Shape{3, 2}, {-2.1, -2.4, -2., -2.2, -0.19999999, 0.8}); + test_case.add_expected_output(Shape{3, 2}, {-2.1f, -2.4f, -2.f, -2.2f, -0.19999999f, 0.8f}); test_case.run(); } -NGRAPH_TEST(${BACKEND_NAME}, onnx_aten_embedding_bag_packed_sum_3in_offsets_none) { +NGRAPH_TEST(${BACKEND_NAME}, onnx_aten_embedding_bag_packed_sum_3fin_offsets_none) { const auto function = onnx_import::import_onnx_model(file_util::path_join(CommonTestUtils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/aten_embedding_sum_packed_3in_offset_none.onnx")); auto test_case = test::TestCase(function, s_device); - test_case.add_input(Shape{5, 2}, {-0.2, -0.6, -0.1, -0.4, -1.9, -1.8, -1., 1.5, 0.8, -0.7}); + test_case.add_input(Shape{5, 2}, {-0.2f, -0.6f, -0.1f, -0.4f, -1.9f, -1.8f, -1.f, 1.5f, 0.8f, -0.7f}); test_case.add_input(Shape{3, 2}, {0, 2, 1, 2, 3, 4}); // indices - test_case.add_expected_output(Shape{3, 2}, {-2.1, -2.4, -2., -2.2, -0.19999999, 0.8}); + test_case.add_expected_output(Shape{3, 2}, {-2.1f, -2.4f, -2.f, -2.2f, -0.19999999f, 0.8f}); test_case.run(); } -NGRAPH_TEST(${BACKEND_NAME}, onnx_aten_embedding_bag_packed_sum_4in_per_sample_weights) { +NGRAPH_TEST(${BACKEND_NAME}, onnx_aten_embedding_bag_packed_sum_4fin_per_sample_weights) { const auto function = onnx_import::import_onnx_model( file_util::path_join(CommonTestUtils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/aten_embedding_sum_packed_4in_per_sample_weights.onnx")); auto test_case = test::TestCase(function, s_device); - test_case.add_input(Shape{5, 2}, {-0.2, -0.6, -0.1, -0.4, -1.9, -1.8, -1., 1.5, 0.8, -0.7}); - test_case.add_input(Shape{3, 2}, {0, 2, 1, 2, 3, 4}); // indices - test_case.add_input(Shape{3, 2}, {0.5, 0.5, 0.5, 0.5, 0.5, 0.5}); // per_sample_weights + test_case.add_input(Shape{5, 2}, {-0.2f, -0.6f, -0.1f, -0.4f, -1.9f, -1.8f, -1.f, 1.5f, 0.8f, -0.7f}); + test_case.add_input(Shape{3, 2}, {0, 2, 1, 2, 3, 4}); // indices + test_case.add_input(Shape{3, 2}, {0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f}); // per_sample_weights - test_case.add_expected_output(Shape{3, 2}, {-1.05, -1.2, -1., -1.1, -0.09999999, 0.4}); + test_case.add_expected_output(Shape{3, 2}, {-1.05f, -1.2f, -1.f, -1.1f, -0.09999999f, 0.4f}); test_case.run(); } @@ -5173,7 +5181,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_aten_embedding_bag_offsets_sum_3in) { "onnx/aten_embedding_sum_offset_3in.onnx")); auto test_case = test::TestCase(function, s_device); - test_case.add_input(Shape{5, 2}, {-0.2, -0.6, -0.1, -0.4, -1.9, -1.8, -1., 1.5, 0.8, -0.7}); + test_case.add_input(Shape{5, 2}, {-0.2f, -0.6f, -0.1f, -0.4f, -1.9f, -1.8f, -1.f, 1.5f, 0.8f, -0.7f}); test_case.add_input(Shape{4}, {0, 2, 3, 4}); // indices test_case.add_input(Shape{3}, {0, 2, 2}); // offsets @@ -5188,12 +5196,12 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_aten_embedding_bag_offsets_sum_4in) { "onnx/aten_embedding_sum_offset_4in.onnx")); auto test_case = test::TestCase(function, s_device); - test_case.add_input(Shape{5, 2}, {-0.2, -0.6, -0.1, -0.4, -1.9, -1.8, -1., 1.5, 0.8, -0.7}); - test_case.add_input(Shape{4}, {0, 2, 3, 4}); // indices - test_case.add_input(Shape{3}, {0, 2, 2}); // offsets - test_case.add_input(Shape{4}, {0.5, 0.5, 0.5, 0.5}); // per_sample_weights + test_case.add_input(Shape{5, 2}, {-0.2f, -0.6f, -0.1f, -0.4f, -1.9f, -1.8f, -1.f, 1.5f, 0.8f, -0.7f}); + test_case.add_input(Shape{4}, {0, 2, 3, 4}); // indices + test_case.add_input(Shape{3}, {0, 2, 2}); // offsets + test_case.add_input(Shape{4}, {0.5f, 0.5f, 0.5f, 0.5f}); // per_sample_weights - test_case.add_expected_output(Shape{3, 2}, {-1.05, -1.2, 0., 0., -0.09999999, 0.4}); + test_case.add_expected_output(Shape{3, 2}, {-1.05f, -1.2f, 0.f, 0.f, -0.09999999f, 0.4f}); test_case.run(); } @@ -5208,11 +5216,11 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_aten_embedding_bag_many_node_outputs) { EXPECT_EQ(function->get_results().size(), 1); auto test_case = test::TestCase(function, s_device); - test_case.add_input(Shape{5, 2}, {-0.2, -0.6, -0.1, -0.4, -1.9, -1.8, -1., 1.5, 0.8, -0.7}); + test_case.add_input(Shape{5, 2}, {-0.2f, -0.6f, -0.1f, -0.4f, -1.9f, -1.8f, -1.f, 1.5f, 0.8f, -0.7f}); test_case.add_input(Shape{4}, {0, 2, 3, 4}); // indices test_case.add_input(Shape{3}, {0, 2, 2}); // offsets - test_case.add_expected_output(Shape{3, 2}, {-2.1, -2.4, 0, 0, -0.2, 0.8}); + test_case.add_expected_output(Shape{3, 2}, {-2.1f, -2.4f, 0.f, 0.f, -0.2f, 0.8f}); test_case.run(); } @@ -5388,10 +5396,11 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_scan15_fib_like_input_rev) { auto test_case = test::TestCase(function, s_device); test_case.add_input(Shape{}, {0}); test_case.add_input(Shape{}, {1}); - test_case.add_input(Shape{10}, std::vector{0., 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9}); + test_case.add_input(Shape{10}, + std::vector{0.f, 0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f}); - test_case.add_expected_output(Shape{}, {0.14897026}); - test_case.add_expected_output(Shape{}, {0.}); + test_case.add_expected_output(Shape{}, {0.14897026f}); + test_case.add_expected_output(Shape{}, {0.f}); test_case.add_expected_output( Shape{10}, {0.9, 1.52, 1.694, 1.9284, 1.8112, 1.4958401, 0.9921121, 0.49759045, 0.14897026, 0.}); @@ -5407,13 +5416,14 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_scan15_fib_like_input_out_rev) { auto test_case = test::TestCase(function, s_device); test_case.add_input(Shape{}, {0}); test_case.add_input(Shape{}, {1}); - test_case.add_input(Shape{10}, std::vector{0., 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9}); + test_case.add_input(Shape{10}, + std::vector{0.f, 0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f}); - test_case.add_expected_output(Shape{}, {0.14897026}); + test_case.add_expected_output(Shape{}, {0.14897026f}); test_case.add_expected_output(Shape{}, {0.}); test_case.add_expected_output( Shape{10}, - {0., 0.14897026, 0.49759045, 0.9921121, 1.4958401, 1.8112, 1.9284, 1.694, 1.52, 0.9}); + {0.f, 0.14897026f, 0.49759045f, 0.9921121f, 1.4958401f, 1.8112f, 1.9284f, 1.694f, 1.52f, 0.9f}); test_case.run(); } @@ -5435,27 +5445,29 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_scan15_ND_mixed_ones) { test_case.run(); } -NGRAPH_TEST(${BACKEND_NAME}, onnx_scan15_ND_mixed_vals) { +NGRAPH_TEST(${BACKEND_NAME}, onnx_scan15f_ND_mixed_vals) { const auto function = onnx_import::import_onnx_model( file_util::path_join(CommonTestUtils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/scan15_ND_mixed.onnx")); auto test_case = test::TestCase(function, s_device); - test_case.add_input(Shape{1, 3, 2}, {0, 0, 0, 0, 0, 0}); - test_case.add_input(Shape{1, 3, 2}, {1, 1, 1, 1, 1, 1}); - std::vector sequence_vals{0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1., 1.1, 1.2, 1.3, 1.4, 1.5, - 1.6, 1.7, 1.8, 1.9, 2., 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.}; + test_case.add_input(Shape{1, 3, 2}, {0.f, 0.f, 0.f, 0.f, 0.f, 0.f}); + test_case.add_input(Shape{1, 3, 2}, {1.f, 1.f, 1.f, 1.f, 1.f, 1.f}); + std::vector sequence_vals{0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.f, + 1.1f, 1.2f, 1.3f, 1.4f, 1.5f, 1.6f, 1.7, 1.8f, 1.9f, 2.f, + 2.1f, 2.2f, 2.3f, 2.4f, 2.5f, 2.6f, 2.7f, 2.8f, 2.9f, 3.f}; test_case.add_input(Shape{1, 3, 5, 2}, sequence_vals); // multiply factor (reverse) test_case.add_input(Shape{1, 5, 3, 2}, sequence_vals); // div factor test_case.add_expected_output(Shape{1, 3, 2}, - {2.7327938, 2.1428573, 21.070545, 16.92727, 49.765778, 41.444443}); + {2.7327938f, 2.1428573f, 21.070545f, 16.92727f, 49.765778f, 41.444443f}); test_case.add_expected_output(Shape{1, 3, 2}, - {0.40161943, 0.5274726, 16.80789, 14.025973, 59.98805, 50.518517}); + {0.40161943f, 0.5274726f, 16.80789f, 14.025973f, 59.98805f, 50.518517f}); test_case.add_expected_output( Shape{1, 3, 2, 5}, - {0.40161943, 2.7327938, 7.3076925, 10., 9., 0.5274726, 2.1428573, 4.714286, 6., 5., - 16.80789, 21.070545, 20.185184, 13.851851, 6.333333, 14.025973, 16.92727, 15.799998, 10.799999, 5., - 59.98805, 49.765778, 33.074867, 16.690908, 5.8, 50.518517, 41.444443, 27.444445, 14., 5.}); + {0.40161943f, 2.7327938f, 7.3076925f, 10.f, 9.f, 0.5274726f, 2.1428573f, 4.714286f, + 6.f, 5.f, 16.80789f, 21.070545f, 20.185184f, 13.851851f, 6.333333f, 14.025973f, + 16.92727f, 15.799998f, 10.799999f, 5.f, 59.98805f, 49.765778f, 33.074867f, 16.690908f, + 5.8f, 50.518517f, 41.444443f, 27.444445f, 14.f, 5.f}); test_case.run(); } @@ -5466,22 +5478,24 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_scan15_ND_mixed_vals_neg_axes) { "onnx/scan15_ND_mixed_neg_axes.onnx")); auto test_case = test::TestCase(function, s_device); - test_case.add_input(Shape{1, 3, 2}, {0, 0, 0, 0, 0, 0}); - test_case.add_input(Shape{1, 3, 2}, {1, 1, 1, 1, 1, 1}); - std::vector sequence_vals{0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1., 1.1, 1.2, 1.3, 1.4, 1.5, - 1.6, 1.7, 1.8, 1.9, 2., 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.}; + test_case.add_input(Shape{1, 3, 2}, {0.f, 0.f, 0.f, 0.f, 0.f, 0.f}); + test_case.add_input(Shape{1, 3, 2}, {1.f, 1.f, 1.f, 1.f, 1.f, 1.f}); + std::vector sequence_vals{0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.f, + 1.1f, 1.2f, 1.3f, 1.4f, 1.5f, 1.6f, 1.7f, 1.8f, 1.9f, 2.f, + 2.1f, 2.2f, 2.3f, 2.4f, 2.5f, 2.6f, 2.7f, 2.8f, 2.9f, 3.f}; test_case.add_input(Shape{1, 3, 5, 2}, sequence_vals); // multiply factor (reverse) test_case.add_input(Shape{1, 5, 3, 2}, sequence_vals); // div factor test_case.add_expected_output(Shape{1, 3, 2}, - {2.7327938, 2.1428573, 21.070545, 16.92727, 49.765778, 41.444443}); + {2.7327938f, 2.1428573f, 21.070545f, 16.92727f, 49.765778f, 41.444443f}); test_case.add_expected_output(Shape{1, 3, 2}, - {0.40161943, 0.5274726, 16.80789, 14.025973, 59.98805, 50.518517}); + {0.40161943f, 0.5274726f, 16.80789f, 14.025973f, 59.98805f, 50.518517f}); test_case.add_expected_output( Shape{1, 3, 2, 5}, - {0.40161943, 2.7327938, 7.3076925, 10., 9., 0.5274726, 2.1428573, 4.714286, 6., 5., - 16.80789, 21.070545, 20.185184, 13.851851, 6.333333, 14.025973, 16.92727, 15.799998, 10.799999, 5., - 59.98805, 49.765778, 33.074867, 16.690908, 5.8, 50.518517, 41.444443, 27.444445, 14., 5.}); + {0.40161943f, 2.7327938f, 7.3076925f, 10.f, 9.f, 0.5274726f, 2.1428573f, 4.714286f, + 6.f, 5.f, 16.80789f, 21.070545f, 20.185184f, 13.851851f, 6.333333f, 14.025973f, + 16.92727f, 15.799998f, 10.799999f, 5.f, 59.98805f, 49.765778f, 33.074867f, 16.690908f, + 5.8f, 50.518517f, 41.444443f, 27.444445f, 14.f, 5.f}); test_case.run(); } @@ -5490,22 +5504,24 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_scan15_dyn_rank_vals) { file_util::path_join(CommonTestUtils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/scan15_dyn_rank.onnx")); auto test_case = test::TestCase(function, s_device); - test_case.add_input(Shape{1, 3, 2}, {0, 0, 0, 0, 0, 0}); - test_case.add_input(Shape{1, 3, 2}, {1, 1, 1, 1, 1, 1}); - std::vector sequence_vals{0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1., 1.1, 1.2, 1.3, 1.4, 1.5, - 1.6, 1.7, 1.8, 1.9, 2., 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.}; + test_case.add_input(Shape{1, 3, 2}, {0.f, 0.f, 0.f, 0.f, 0.f, 0.f}); + test_case.add_input(Shape{1, 3, 2}, {1.f, 1.f, 1.f, 1.f, 1.f, 1.f}); + std::vector sequence_vals{0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.f, + 1.1f, 1.2f, 1.3f, 1.4f, 1.5f, 1.6f, 1.7f, 1.8f, 1.9f, 2.f, + 2.1f, 2.2f, 2.3f, 2.4f, 2.5f, 2.6f, 2.7f, 2.8f, 2.9f, 3.f}; test_case.add_input(Shape{1, 3, 5, 2}, sequence_vals); // multiply factor (reverse) test_case.add_input(Shape{1, 5, 3, 2}, sequence_vals); // div factor test_case.add_expected_output(Shape{1, 3, 2}, - {2.7327938, 2.1428573, 21.070545, 16.92727, 49.765778, 41.444443}); + {2.7327938f, 2.1428573f, 21.070545f, 16.92727f, 49.765778f, 41.444443f}); test_case.add_expected_output(Shape{1, 3, 2}, - {0.40161943, 0.5274726, 16.80789, 14.025973, 59.98805, 50.518517}); + {0.40161943f, 0.5274726f, 16.80789f, 14.025973f, 59.98805f, 50.518517f}); test_case.add_expected_output( Shape{1, 3, 2, 5}, - {0.40161943, 2.7327938, 7.3076925, 10., 9., 0.5274726, 2.1428573, 4.714286, 6., 5., - 16.80789, 21.070545, 20.185184, 13.851851, 6.333333, 14.025973, 16.92727, 15.799998, 10.799999, 5., - 59.98805, 49.765778, 33.074867, 16.690908, 5.8, 50.518517, 41.444443, 27.444445, 14., 5.}); + {0.40161943f, 2.7327938f, 7.3076925f, 10.f, 9.f, 0.5274726f, 2.1428573f, 4.714286f, + 6.f, 5.f, 16.80789f, 21.070545f, 20.185184f, 13.851851f, 6.333333f, 14.025973f, + 16.92727f, 15.799998f, 10.799999f, 5.f, 59.98805f, 49.765778f, 33.074867f, 16.690908f, + 5.8f, 50.518517f, 41.444443f, 27.444445f, 14.f, 5.f}); test_case.run(); } @@ -5529,43 +5545,46 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_scan15_ND_b4_input_rev_vals) { "onnx/scan15_ND_b4_input_rev.onnx")); auto test_case = test::TestCase(function, s_device); - test_case.add_input(Shape{4, 3, 2}, std::vector(24, 0)); - test_case.add_input(Shape{4, 3, 2}, std::vector(24, 1)); + test_case.add_input(Shape{4, 3, 2}, std::vector(24.f, 0.f)); + test_case.add_input(Shape{4, 3, 2}, std::vector(24.f, 1.f)); std::vector sequence_vals{ - 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1., 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, - 1.9, 2., 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3., 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, - 3.7, 3.8, 3.9, 4., 4.1, 4.2, 4.3, 4.4, 4.5, 4.6, 4.7, 4.8, 4.9, 5., 5.1, 5.2, 5.3, 5.4, - 5.5, 5.6, 5.7, 5.8, 5.9, 6., 6.1, 6.2, 6.3, 6.4, 6.5, 6.6, 6.7, 6.8, 6.9, 7., 7.1, 7.2, - 7.3, 7.4, 7.5, 7.6, 7.7, 7.8, 7.9, 8., 8.1, 8.2, 8.3, 8.4, 8.5, 8.6, 8.7, 8.8, 8.9, 9., - 9.1, 9.2, 9.3, 9.4, 9.5, 9.6, 9.7, 9.8, 9.9, 10., 10.1, 10.2, 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, - 10.9, 11., 11.1, 11.2, 11.3, 11.4, 11.5, 11.6, 11.7, 11.8, 11.9, 12.}; + 0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.f, 1.1f, 1.2f, 1.3f, 1.4f, 1.5f, + 1.6f, 1.7f, 1.8f, 1.9f, 2.f, 2.1f, 2.2f, 2.3f, 2.4f, 2.5f, 2.6f, 2.7f, 2.8f, 2.9f, 3.f, + 3.1f, 3.2f, 3.3f, 3.4f, 3.5f, 3.6f, 3.7f, 3.8f, 3.9f, 4.f, 4.1f, 4.2f, 4.3f, 4.4f, 4.5f, + 4.6f, 4.7f, 4.8f, 4.9f, 5.f, 5.1f, 5.2f, 5.3f, 5.4f, 5.5f, 5.6f, 5.7f, 5.8f, 5.9f, 6.f, + 6.1f, 6.2f, 6.3f, 6.4f, 6.5f, 6.6f, 6.7f, 6.8f, 6.9f, 7.f, 7.1f, 7.2f, 7.3f, 7.4f, 7.5f, + 7.6f, 7.7f, 7.8f, 7.9f, 8.f, 8.1f, 8.2f, 8.3f, 8.4f, 8.5f, 8.6f, 8.7f, 8.8f, 8.9f, 9.f, + 9.1f, 9.2f, 9.3f, 9.4f, 9.5f, 9.6f, 9.7f, 9.8f, 9.9f, 10.f, 10.1f, 10.2f, 10.3f, 10.4f, 10.5f, + 10.6f, 10.7f, 10.8f, 10.9f, 11.f, 11.1f, 11.2f, 11.3f, 11.4f, 11.5f, 11.6f, 11.7f, 11.8f, 11.9f, 12.f}; test_case.add_input(Shape{4, 5, 3, 2}, sequence_vals); // multiply factor (reverse) test_case.add_input(Shape{4, 5, 3, 2}, sequence_vals); // div factor test_case.add_expected_output( Shape{4, 3, 2}, - {61.210526, 33.2, 23.857145, 19.181818, 16.373913, 14.5, 6.8880844, 6.83, - 6.7754016, 6.7239814, 6.6754713, 6.6296296, 5.9686656, 5.953226, 5.9382715, 5.9237804, - 5.9097314, 5.896105, 5.652082, 5.645059, 5.638186, 5.6314588, 5.624872, 5.618421}); + {61.210526f, 33.2f, 23.857145f, 19.181818f, 16.373913f, 14.5f, 6.8880844f, 6.83f, + 6.7754016f, 6.7239814f, 6.6754713f, 6.6296296f, 5.9686656f, 5.953226f, 5.9382715f, 5.9237804f, + 5.9097314f, 5.896105f, 5.652082f, 5.645059f, 5.638186f, 5.6314588f, 5.624872f, 5.618421f}); test_case.add_expected_output( Shape{4, 3, 2}, - {6.271278, 6.2461543, 6.2433867, 6.2545457, 6.2744985, 6.3, 6.9531364, 6.970527, - 6.987378, 7.003712, 7.019554, 7.034921, 7.30868, 7.3164845, 7.324116, 7.3315806, - 7.338885, 7.346032, 7.485426, 7.489783, 7.494067, 7.49828, 7.5024257, 7.506502}); + {6.271278f, 6.2461543f, 6.2433867f, 6.2545457f, 6.2744985f, 6.3f, 6.9531364f, 6.970527f, + 6.987378f, 7.003712f, 7.019554f, 7.034921f, 7.30868f, 7.3164845f, 7.324116f, 7.3315806f, + 7.338885f, 7.346032f, 7.485426f, 7.489783f, 7.494067f, 7.49828f, 7.5024257f, 7.506502f}); test_case.add_expected_output( Shape{5, 4, 3, 2}, - {25., 13., 9., 7., 5.8, 5., 1.7741936, 1.75, 1.7272727, 1.7058823, - 1.6857144, 1.6666667, 1.3934426, 1.3870969, 1.3809522, 1.375, 1.3692307, 1.3636364, 1.2637362, 1.2608696, - 1.2580644, 1.2553192, 1.2526315, 1.25, 70.57143, 35., 23.333334, 17.6, 14.218181, 12., - 3.6739323, 3.618421, 3.5664334, 3.5176468, 3.471777, 3.4285717, 2.822119, 2.8083491, 2.7950313, 2.7821426, - 2.7696643, 2.757576, 2.543786, 2.5377107, 2.5317693, 2.5259573, 2.520271, 2.514706, 95.57143, 47.999996, - 32.333336, 24.6, 20.01818, 17., 5.448126, 5.368421, 5.293706, 5.223529, 5.157491, 5.0952387, - 4.215562, 4.195446, 4.1759834, 4.1571426, 4.138895, 4.1212125, 3.8075223, 3.7985802, 3.7898335, 3.7812767, - 3.7729027, 3.764706, 61.210526, 33.2, 23.857145, 19.181818, 16.373913, 14.5, 6.8880844, 6.83, - 6.7754016, 6.7239814, 6.6754713, 6.6296296, 5.9686656, 5.953226, 5.9382715, 5.9237804, 5.9097314, 5.896105, - 5.652082, 5.645059, 5.638186, 5.6314588, 5.624872, 5.618421, 6.271278, 6.2461543, 6.2433867, 6.2545457, - 6.2744985, 6.3, 6.9531364, 6.970527, 6.987378, 7.003712, 7.019554, 7.034921, 7.30868, 7.3164845, - 7.324116, 7.3315806, 7.338885, 7.346032, 7.485426, 7.489783, 7.494067, 7.49828, 7.5024257, 7.506502}); + {25.f, 13.f, 9.f, 7.f, 5.8f, 5.f, 1.7741936f, 1.75f, 1.7272727f, + 1.7058823f, 1.6857144f, 1.6666667f, 1.3934426f, 1.3870969f, 1.3809522f, 1.375f, 1.3692307f, 1.3636364f, + 1.2637362f, 1.2608696f, 1.2580644f, 1.2553192f, 1.2526315f, 1.25f, 70.57143f, 35.f, 23.333334f, + 17.6f, 14.218181f, 12.f, 3.6739323f, 3.618421f, 3.5664334f, 3.5176468f, 3.471777f, 3.4285717f, + 2.822119f, 2.8083491f, 2.7950313f, 2.7821426f, 2.7696643f, 2.757576f, 2.543786f, 2.5377107f, 2.5317693f, + 2.5259573f, 2.520271f, 2.514706f, 95.57143f, 47.999996f, 32.333336f, 24.6f, 20.01818f, 17.f, + 5.448126f, 5.368421f, 5.293706f, 5.223529f, 5.157491f, 5.0952387f, 4.215562f, 4.195446f, 4.1759834f, + 4.1571426f, 4.138895f, 4.1212125f, 3.8075223f, 3.7985802f, 3.7898335f, 3.7812767f, 3.7729027f, 3.764706f, + 61.210526f, 33.2f, 23.857145f, 19.181818f, 16.373913f, 14.5f, 6.8880844f, 6.83f, 6.7754016f, + 6.7239814f, 6.6754713f, 6.6296296f, 5.9686656f, 5.953226f, 5.9382715f, 5.9237804f, 5.9097314f, 5.896105f, + 5.652082f, 5.645059f, 5.638186f, 5.6314588f, 5.624872f, 5.618421f, 6.271278f, 6.2461543f, 6.2433867f, + 6.2545457f, 6.2744985f, 6.3f, 6.9531364f, 6.970527f, 6.987378f, 7.003712f, 7.019554f, 7.034921f, + 7.30868f, 7.3164845f, 7.324116f, 7.3315806f, 7.338885f, 7.346032f, 7.485426f, 7.489783f, 7.494067f, + 7.49828f, 7.5024257f, 7.506502f}); test_case.run(); } @@ -5600,43 +5619,46 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_scan8_ND_b4_input_rev_vals) { "onnx/scan8_ND_b4_input_rev.onnx")); auto test_case = test::TestCase(function, s_device); - test_case.add_input(Shape{4, 3, 2}, std::vector(24, 0)); - test_case.add_input(Shape{4, 3, 2}, std::vector(24, 1)); + test_case.add_input(Shape{4, 3, 2}, std::vector(24.f, 0.f)); + test_case.add_input(Shape{4, 3, 2}, std::vector(24.f, 1.f)); std::vector sequence_vals{ - 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1., 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, - 1.9, 2., 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3., 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, - 3.7, 3.8, 3.9, 4., 4.1, 4.2, 4.3, 4.4, 4.5, 4.6, 4.7, 4.8, 4.9, 5., 5.1, 5.2, 5.3, 5.4, - 5.5, 5.6, 5.7, 5.8, 5.9, 6., 6.1, 6.2, 6.3, 6.4, 6.5, 6.6, 6.7, 6.8, 6.9, 7., 7.1, 7.2, - 7.3, 7.4, 7.5, 7.6, 7.7, 7.8, 7.9, 8., 8.1, 8.2, 8.3, 8.4, 8.5, 8.6, 8.7, 8.8, 8.9, 9., - 9.1, 9.2, 9.3, 9.4, 9.5, 9.6, 9.7, 9.8, 9.9, 10., 10.1, 10.2, 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, - 10.9, 11., 11.1, 11.2, 11.3, 11.4, 11.5, 11.6, 11.7, 11.8, 11.9, 12.}; + 0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.f, 1.1f, 1.2f, 1.3f, 1.4f, 1.5f, + 1.6f, 1.7f, 1.8f, 1.9f, 2.f, 2.1f, 2.2f, 2.3f, 2.4f, 2.5f, 2.6f, 2.7f, 2.8f, 2.9f, 3.f, + 3.1f, 3.2f, 3.3f, 3.4f, 3.5f, 3.6f, 3.7f, 3.8f, 3.9f, 4.f, 4.1f, 4.2f, 4.3f, 4.4f, 4.5f, + 4.6f, 4.7f, 4.8f, 4.9f, 5.f, 5.1f, 5.2f, 5.3f, 5.4f, 5.5f, 5.6f, 5.7f, 5.8f, 5.9f, 6.f, + 6.1f, 6.2f, 6.3f, 6.4f, 6.5f, 6.6f, 6.7f, 6.8f, 6.9f, 7.f, 7.1f, 7.2f, 7.3f, 7.4f, 7.5f, + 7.6f, 7.7f, 7.8f, 7.9f, 8.f, 8.1f, 8.2f, 8.3f, 8.4f, 8.5f, 8.6f, 8.7f, 8.8f, 8.9f, 9.f, + 9.1f, 9.2f, 9.3f, 9.4f, 9.5f, 9.6f, 9.7f, 9.8f, 9.9f, 10.f, 10.1f, 10.2f, 10.3f, 10.4f, 10.5f, + 10.6f, 10.7f, 10.8f, 10.9f, 11.f, 11.1f, 11.2f, 11.3f, 11.4f, 11.5f, 11.6f, 11.7f, 11.8f, 11.9f, 12.f}; test_case.add_input(Shape{4, 5, 3, 2}, sequence_vals); // multiply factor (reverse) test_case.add_input(Shape{4, 5, 3, 2}, sequence_vals); // div factor test_case.add_expected_output( Shape{4, 3, 2}, - {61.210526, 33.2, 23.857145, 19.181818, 16.373913, 14.5, 6.8880844, 6.83, - 6.7754016, 6.7239814, 6.6754713, 6.6296296, 5.9686656, 5.953226, 5.9382715, 5.9237804, - 5.9097314, 5.896105, 5.652082, 5.645059, 5.638186, 5.6314588, 5.624872, 5.618421}); + {61.210526f, 33.2f, 23.857145f, 19.181818f, 16.373913f, 14.5f, 6.8880844f, 6.83f, + 6.7754016f, 6.7239814f, 6.6754713f, 6.6296296f, 5.9686656f, 5.953226f, 5.9382715f, 5.9237804f, + 5.9097314f, 5.896105f, 5.652082f, 5.645059f, 5.638186f, 5.6314588f, 5.624872f, 5.618421f}); test_case.add_expected_output( Shape{4, 3, 2}, - {6.271278, 6.2461543, 6.2433867, 6.2545457, 6.2744985, 6.3, 6.9531364, 6.970527, - 6.987378, 7.003712, 7.019554, 7.034921, 7.30868, 7.3164845, 7.324116, 7.3315806, - 7.338885, 7.346032, 7.485426, 7.489783, 7.494067, 7.49828, 7.5024257, 7.506502}); + {6.271278f, 6.2461543f, 6.2433867f, 6.2545457f, 6.2744985f, 6.3f, 6.9531364f, 6.970527f, + 6.987378f, 7.003712f, 7.019554f, 7.034921f, 7.30868f, 7.3164845f, 7.324116f, 7.3315806f, + 7.338885f, 7.346032f, 7.485426f, 7.489783f, 7.494067f, 7.49828f, 7.5024257f, 7.506502f}); test_case.add_expected_output( Shape{4, 5, 3, 2}, - {25., 13., 9., 7., 5.8, 5., 70.57143, 35., 23.333334, 17.6, - 14.218181, 12., 95.57143, 47.999996, 32.333336, 24.6, 20.01818, 17., 61.210526, 33.2, - 23.857145, 19.181818, 16.373913, 14.5, 6.271278, 6.2461543, 6.2433867, 6.2545457, 6.2744985, 6.3, - 1.7741936, 1.75, 1.7272727, 1.7058823, 1.6857144, 1.6666667, 3.6739323, 3.618421, 3.5664334, 3.5176468, - 3.471777, 3.4285717, 5.448126, 5.368421, 5.293706, 5.223529, 5.157491, 5.0952387, 6.8880844, 6.83, - 6.7754016, 6.7239814, 6.6754713, 6.6296296, 6.9531364, 6.970527, 6.987378, 7.003712, 7.019554, 7.034921, - 1.3934426, 1.3870969, 1.3809522, 1.375, 1.3692307, 1.3636364, 2.822119, 2.8083491, 2.7950313, 2.7821426, - 2.7696643, 2.757576, 4.215562, 4.195446, 4.1759834, 4.1571426, 4.138895, 4.1212125, 5.9686656, 5.953226, - 5.9382715, 5.9237804, 5.9097314, 5.896105, 7.30868, 7.3164845, 7.324116, 7.3315806, 7.338885, 7.346032, - 1.2637362, 1.2608696, 1.2580644, 1.2553192, 1.2526315, 1.25, 2.543786, 2.5377107, 2.5317693, 2.5259573, - 2.520271, 2.514706, 3.8075223, 3.7985802, 3.7898335, 3.7812767, 3.7729027, 3.764706, 5.652082, 5.645059, - 5.638186, 5.6314588, 5.624872, 5.618421, 7.485426, 7.489783, 7.494067, 7.49828, 7.5024257, 7.506502}); + {25.f, 13.f, 9.f, 7.f, 5.8f, 5.f, 70.57143f, 35.f, 23.333334f, + 17.6f, 14.218181f, 12.f, 95.57143f, 47.999996f, 32.333336f, 24.6f, 20.01818f, 17.f, + 61.210526f, 33.2f, 23.857145f, 19.181818f, 16.373913f, 14.5f, 6.271278f, 6.2461543f, 6.2433867f, + 6.2545457f, 6.2744985f, 6.3f, 1.7741936f, 1.75f, 1.7272727f, 1.7058823f, 1.6857144f, 1.6666667f, + 3.6739323f, 3.618421f, 3.5664334f, 3.5176468f, 3.471777f, 3.4285717f, 5.448126f, 5.368421f, 5.293706f, + 5.223529f, 5.157491f, 5.0952387f, 6.8880844f, 6.83f, 6.7754016f, 6.7239814f, 6.6754713f, 6.6296296f, + 6.9531364f, 6.970527f, 6.987378f, 7.003712f, 7.019554f, 7.034921f, 1.3934426f, 1.3870969f, 1.3809522f, + 1.375f, 1.3692307f, 1.3636364f, 2.822119f, 2.8083491f, 2.7950313f, 2.7821426f, 2.7696643f, 2.757576f, + 4.215562f, 4.195446f, 4.1759834f, 4.1571426f, 4.138895f, 4.1212125f, 5.9686656f, 5.953226f, 5.9382715f, + 5.9237804f, 5.9097314f, 5.896105f, 7.30868f, 7.3164845f, 7.324116f, 7.3315806f, 7.338885f, 7.346032f, + 1.2637362f, 1.2608696f, 1.2580644f, 1.2553192f, 1.2526315f, 1.25f, 2.543786f, 2.5377107f, 2.5317693f, + 2.5259573f, 2.520271f, 2.514706f, 3.8075223f, 3.7985802f, 3.7898335f, 3.7812767f, 3.7729027f, 3.764706f, + 5.652082f, 5.645059f, 5.638186f, 5.6314588f, 5.624872f, 5.618421f, 7.485426f, 7.489783f, 7.494067f, + 7.49828f, 7.5024257f, 7.506502f}); test_case.run(); } @@ -5658,10 +5680,18 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_softsign) { auto model = onnx_import::import_onnx_model( file_util::path_join(CommonTestUtils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/softsign.onnx")); - Inputs inputs{std::vector{1.0, 0.1, 20.0, 12.0, -12.0, -0.2, 0.5, 100.0, 0.0, -1.0}}; + Inputs inputs{std::vector{1.0f, 0.1f, 20.0f, 12.0f, -12.0f, -0.2f, 0.5f, 100.0f, 0.0f, -1.0f}}; - std::vector - output{0.5, 0.09090909, 0.95238096, 0.9230769, -0.9230769, -0.16666666, 0.33333334, 0.990099, 0., -0.5}; + std::vector output{0.5f, + 0.09090909f, + 0.95238096f, + 0.9230769f, + -0.9230769f, + -0.16666666f, + 0.33333334f, + 0.990099f, + 0.f, + -0.5f}; auto test_case = test::TestCase(model, s_device); test_case.add_multiple_inputs(inputs); @@ -6287,7 +6317,7 @@ NGRAPH_TEST(${BACKEND_NAME}, castlike_int32_to_float) { test_case.add_input(Shape{1, 1, 2, 2}, std::vector{-1, 2, 3, 4}); test_case.add_input(Shape{4}, {1, 2, 3, 4}); - test_case.add_expected_output(std::vector{-1.0, 2.0, 3.0, 4.0}); + test_case.add_expected_output(std::vector{-1.0f, 2.0f, 3.0f, 4.0f}); test_case.run(); } @@ -6299,7 +6329,7 @@ NGRAPH_TEST(${BACKEND_NAME}, castlike_float64_to_int32) { auto test_case = test::TestCase(function, s_device); - test_case.add_input(Shape{1, 1, 2, 2}, std::vector{-107374.9876543, -2.2, 3.3, 4.4}); + test_case.add_input(Shape{1, 1, 2, 2}, std::vector{-107374.9876543f, -2.2f, 3.3f, 4.4f}); test_case.add_input(Shape{4}, {1, 2, 3, 4}); test_case.add_expected_output(std::vector{-107374, -2, 3, 4}); @@ -6313,7 +6343,9 @@ NGRAPH_TEST(${BACKEND_NAME}, DISABLED_castlike_float32_to_bfloat16) { auto test_case = test::TestCase(function, s_device); - test_case.add_input(Shape{3, 4}, std::vector{121.5, 122.7, 3, 4, 5, 6, 7, 8.8, 9, 10, 11, 12}); + test_case.add_input( + Shape{3, 4}, + std::vector{121.5f, 122.7f, 3.f, 4.f, 5.f, 6.f, 7.f, 8.8f, 9.f, 10.f, 11.f, 12.f}); test_case.add_input(Shape{3, 4}, {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}); test_case.add_expected_output(std::vector{121.5, 122.7, 3, 4, 5, 6, 7, 8.8, 9, 10, 11, 12}); From b94123d07589b43fa4647db4731ebdd5ef87c9be Mon Sep 17 00:00:00 2001 From: Mateusz Bencer Date: Wed, 15 Mar 2023 22:25:18 +0100 Subject: [PATCH 12/28] fixed next float casting --- .../onnx/tests/onnx_import_controlflow.in.cpp | 2 +- .../onnx/tests/onnx_import_dyn_shapes.in.cpp | 47 ++++++++++--------- 2 files changed, 26 insertions(+), 23 deletions(-) diff --git a/src/frontends/onnx/tests/onnx_import_controlflow.in.cpp b/src/frontends/onnx/tests/onnx_import_controlflow.in.cpp index 6908c0b9992251..5ae4fb25f5ea0f 100644 --- a/src/frontends/onnx/tests/onnx_import_controlflow.in.cpp +++ b/src/frontends/onnx/tests/onnx_import_controlflow.in.cpp @@ -537,7 +537,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_if_branches_with_same_inputs) { auto test_case = test::TestCase(function, s_device); std::vector x(40, 2); std::vector y(40); - std::iota(y.begin(), y.end(), -20); + std::iota(y.begin(), y.end(), -20.f); // condition test_case.add_input({true}); diff --git a/src/frontends/onnx/tests/onnx_import_dyn_shapes.in.cpp b/src/frontends/onnx/tests/onnx_import_dyn_shapes.in.cpp index 2afbdef3999159..89e05cb6a9b9f7 100644 --- a/src/frontends/onnx/tests/onnx_import_dyn_shapes.in.cpp +++ b/src/frontends/onnx/tests/onnx_import_dyn_shapes.in.cpp @@ -220,7 +220,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_model_asinh_3_2) { auto test_case = test::TestCase(function, s_device); test_case.add_input(Shape{3, 2}, {-1.5f, 0.0f, 1.5f, -1.5f, 0.0f, 1.5f}); - test_case.add_expected_output(Shape{3, 2}, {-1.1947632f, 0.0f, 1.1947632f, -1.1947632, 0.0f, 1.1947632f}); + test_case.add_expected_output(Shape{3, 2}, {-1.1947632f, 0.0f, 1.1947632f, -1.1947632f, 0.0f, 1.1947632f}); test_case.run(); } @@ -729,9 +729,12 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_transpose) { namespace { Shape get_flattened_shape(const Shape& in_shape, size_t axis) { - size_t first_dim_size = - std::accumulate(begin(in_shape), next(begin(in_shape), axis), 1UL, std::multiplies()); - size_t last_dim_size = std::accumulate(next(begin(in_shape), axis), end(in_shape), 1UL, std::multiplies()); + size_t first_dim_size = std::accumulate(begin(in_shape), + next(begin(in_shape), axis), + static_cast(1), + std::multiplies()); + size_t last_dim_size = + std::accumulate(next(begin(in_shape), axis), end(in_shape), static_cast(1), std::multiplies()); return Shape{first_dim_size, last_dim_size}; } } // namespace @@ -1116,34 +1119,34 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_model_softmax_axis_2) { file_util::path_join(CommonTestUtils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/softmax_axis_2.onnx")); const std::vector input = { - 2.75793882, -0.50841322, 0.82013929, -0.62409912, -0.96136118, 0.21004745, 1.38337255, - 1.19030397, 2.0940445, -0.03551657, -0.78686039, 1.992782, 0.04300319, -0.29230777, - -0.56797112, -1.26732165, -0.61935399, 0.57670432, 0.92844898, 2.82469233, + 2.75793882f, -0.50841322f, 0.82013929f, -0.62409912f, -0.96136118f, 0.21004745f, 1.38337255f, + 1.19030397f, 2.0940445f, -0.03551657f, -0.78686039f, 1.992782f, 0.04300319f, -0.29230777f, + -0.56797112f, -1.26732165f, -0.61935399f, 0.57670432f, 0.92844898f, 2.82469233f, - 0.98721677, -0.05100663, -1.21178917, -0.17530157, 1.40051805, -0.13259761, -1.14313018, - 0.2673723, -0.87996154, 1.29053106, 1.55, 0.8396538, 1.20729817, 0.23727845, - -0.89113606, -1.70909842, 0.26460363, -0.70566808, 2.383518, 1.07024615, + 0.98721677f, -0.05100663f, -1.21178917f, -0.17530157f, 1.40051805f, -0.13259761f, -1.14313018f, + 0.2673723f, -0.87996154f, 1.29053106f, 1.55f, 0.8396538f, 1.20729817f, 0.23727845f, + -0.89113606f, -1.70909842f, 0.26460363f, -0.70566808f, 2.383518f, 1.07024615f, - -1.21722605, 0.82919357, 0.55765697, 0.12657686, 0.63432172, 0.75425957, -2.43721014, - -1.24478184, 2.65316853, 1.19509542, -0.95523998, 0.5149006, -0.01151649, 0.68327026, - -0.4589638, -0.46554745, 0.21055324, 0.39266729, 2.05098086, 1.83207919}; + -1.21722605f, 0.82919357f, 0.55765697f, 0.12657686f, 0.63432172f, 0.75425957f, -2.43721014f, + -1.24478184f, 2.65316853f, 1.19509542f, -0.95523998f, 0.5149006f, -0.01151649f, 0.68327026f, + -0.4589638f, -0.46554745f, 0.21055324f, 0.39266729f, 2.05098086f, 1.83207919f}; auto test_case = test::TestCase(function, s_device); test_case.add_input(input); test_case.add_expected_output( Shape{3, 4, 5}, - {0.80619486, 0.03075257, 0.1161086, 0.027393, 0.01955098, 0.07012682, 0.22670066, - 0.18689779, 0.4614171, 0.05485763, 0.04486172, 0.72286838, 0.10286818, 0.07356265, - 0.05583908, 0.01280724, 0.02448298, 0.08096658, 0.11509768, 0.76664552, + {0.80619486f, 0.03075257f, 0.1161086f, 0.027393f, 0.01955098f, 0.07012682f, 0.22670066f, + 0.18689779f, 0.4614171f, 0.05485763f, 0.04486172f, 0.72286838f, 0.10286818f, 0.07356265f, + 0.05583908f, 0.01280724f, 0.02448298f, 0.08096658f, 0.11509768f, 0.76664552f, - 0.30399806, 0.1076406, 0.03371745, 0.0950595, 0.4595844, 0.13369873, 0.04866969, - 0.19944906, 0.06332151, 0.55486101, 0.39101105, 0.19217177, 0.27755913, 0.10521588, - 0.03404216, 0.01150354, 0.08279411, 0.03137732, 0.68902071, 0.18530432, + 0.30399806f, 0.1076406f, 0.03371745f, 0.0950595f, 0.4595844f, 0.13369873f, 0.04866969f, + 0.19944906f, 0.06332151f, 0.55486101f, 0.39101105f, 0.19217177f, 0.27755913f, 0.10521588f, + 0.03404216f, 0.01150354f, 0.08279411f, 0.03137732f, 0.68902071f, 0.18530432f, - 0.0402528, 0.31156222, 0.23747503, 0.1543129, 0.25639705, 0.10627912, 0.00436928, - 0.01439711, 0.70979614, 0.16515835, 0.06798343, 0.2957175, 0.17468555, 0.34994439, - 0.11166912, 0.03615172, 0.07108136, 0.08527994, 0.44775794, 0.35972905}); + 0.0402528f, 0.31156222f, 0.23747503f, 0.1543129f, 0.25639705f, 0.10627912f, 0.00436928f, + 0.01439711f, 0.70979614f, 0.16515835f, 0.06798343f, 0.2957175f, 0.17468555f, 0.34994439f, + 0.11166912f, 0.03615172f, 0.07108136f, 0.08527994f, 0.44775794f, 0.35972905f}); test_case.run(3); } From 37672246be7ec45fccfc0e2f5c9a1a30fab54100 Mon Sep 17 00:00:00 2001 From: Mateusz Bencer Date: Thu, 16 Mar 2023 11:48:16 +0100 Subject: [PATCH 13/28] fixed next float casts --- src/frontends/onnx/tests/onnx_import.in.cpp | 67 +-- .../onnx/tests/onnx_import_dyn_shapes.in.cpp | 2 +- .../onnx/tests/onnx_import_org_pytorch.in.cpp | 38 +- .../onnx/tests/onnx_import_rnn.in.cpp | 442 +++++++++--------- 4 files changed, 281 insertions(+), 268 deletions(-) diff --git a/src/frontends/onnx/tests/onnx_import.in.cpp b/src/frontends/onnx/tests/onnx_import.in.cpp index 4085af9aadec08..78cb2ff488f16e 100644 --- a/src/frontends/onnx/tests/onnx_import.in.cpp +++ b/src/frontends/onnx/tests/onnx_import.in.cpp @@ -797,7 +797,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_softmax_1D) { auto test_case = test::TestCase(function, s_device); test_case.add_input({-1.0, 0.0, 1.0}); - test_case.add_expected_output({0.09003058, 0.24472848, 0.66524094}); + test_case.add_expected_output({0.09003058f, 0.24472848f, 0.66524094f}); test_case.run(); } namespace { @@ -1786,7 +1786,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_resize11_down_sizes_cubic_half_pixel) { test_case.add_input(input_data); test_case.add_expected_output( expected_output_shape, - {1.6307871, 3.0046299, 4.3784733, 7.1261587, 8.5, 9.873844, 12.621532, 13.995373, 15.369216}); + {1.6307871f, 3.0046299f, 4.3784733f, 7.1261587f, 8.5f, 9.873844f, 12.621532f, 13.995373f, 15.369216f}); test_case.run_with_tolerance_as_fp(2.0e-5f); } @@ -1848,18 +1848,18 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_resize11_up_sizes_cubic_half_pixel) { test_case.add_input(input_data); test_case.add_expected_output( expected_output_shape, - {0.45507922f, 0.64057922f, 0.97157922f, 1.42257922f, 1.90732922, 2.22332922f, 2.70807922f, 3.15907922f, + {0.45507922f, 0.64057922f, 0.97157922f, 1.42257922f, 1.90732922f, 2.22332922f, 2.70807922f, 3.15907922f, 3.49007922f, 3.67557922, 1.39437963f, 1.57987963f, 1.91087963f, 2.36187963f, 2.84662963, 3.16262963f, 3.64737963f, 4.09837963f, 4.42937963f, 4.61487963, 2.95130693f, 3.13680693f, 3.46780693f, 3.91880693f, 4.40355693, 4.71955693f, 5.20430693f, 5.65530693f, 5.98630693f, 6.17180693, 5.20525069f, 5.39075069f, 5.72175069f, 6.17275069f, 6.65750069, 6.97350069f, 7.45825069f, 7.90925069f, 8.24025069f, 8.42575069, - 6.88975f, 7.07525f, 7.40625f, 7.85725f, 8.342, 8.658f, 9.14275f, 9.59375f, + 6.88975f, 7.07525f, 7.40625f, 7.85725f, 8.342f, 8.658f, 9.14275f, 9.59375f, 9.92475f, 10.11025f, 8.57424931f, 8.75974931f, 9.09074931f, 9.54174931f, 10.02649931, 10.34249931f, 10.82724931f, 11.27824931f, 11.60924931f, 11.79474931, 10.82819307f, 11.01369307f, 11.34469307f, 11.79569307f, 12.28044307, 12.59644307f, 13.08119307f, 13.53219307f, 13.86319307f, 14.04869307, 12.38512037f, 12.57062037f, 12.90162037f, 13.35262037f, 13.83737037, 14.15337037f, 14.63812037f, 15.08912037f, 15.42012037f, 15.60562037, - 13.32442078f, 13.50992078f, 13.84092078f, 14.29192078f, 14.77667078, 15.09267078f, 15.57742078f, 16.02842078f, - 16.35942078f, 16.54492078}); + 13.32442078f, 13.50992078f, 13.84092078f, 14.29192078f, 14.77667078f, 15.09267078f, 15.57742078f, 16.02842078f, + 16.35942078f, 16.54492078f}); test_case.run_with_tolerance_as_fp(2.0e-5f); } @@ -1891,18 +1891,18 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_resize11_up_sizes_cubic_half_pixel_dynamic_siz test_case.add_input(std::vector{1, 1, 9, 10}); // sizes test_case.add_expected_output( expected_output_shape, - {0.45507922f, 0.64057922f, 0.97157922f, 1.42257922f, 1.90732922, 2.22332922f, 2.70807922f, 3.15907922f, - 3.49007922f, 3.67557922, 1.39437963f, 1.57987963f, 1.91087963f, 2.36187963f, 2.84662963, 3.16262963f, + {0.45507922f, 0.64057922f, 0.97157922f, 1.42257922f, 1.90732922f, 2.22332922f, 2.70807922f, 3.15907922f, + 3.49007922f, 3.67557922, 1.39437963f, 1.57987963f, 1.91087963f, 2.36187963f, 2.84662963f, 3.16262963f, 3.64737963f, 4.09837963f, 4.42937963f, 4.61487963, 2.95130693f, 3.13680693f, 3.46780693f, 3.91880693f, 4.40355693, 4.71955693f, 5.20430693f, 5.65530693f, 5.98630693f, 6.17180693, 5.20525069f, 5.39075069f, - 5.72175069f, 6.17275069f, 6.65750069, 6.97350069f, 7.45825069f, 7.90925069f, 8.24025069f, 8.42575069, - 6.88975f, 7.07525f, 7.40625f, 7.85725f, 8.342, 8.658f, 9.14275f, 9.59375f, - 9.92475f, 10.11025f, 8.57424931f, 8.75974931f, 9.09074931f, 9.54174931f, 10.02649931, 10.34249931f, + 5.72175069f, 6.17275069f, 6.65750069f, 6.97350069f, 7.45825069f, 7.90925069f, 8.24025069f, 8.42575069f, + 6.88975f, 7.07525f, 7.40625f, 7.85725f, 8.342f, 8.658f, 9.14275f, 9.59375f, + 9.92475f, 10.11025f, 8.57424931f, 8.75974931f, 9.09074931f, 9.54174931f, 10.02649931f, 10.34249931f, 10.82724931f, 11.27824931f, 11.60924931f, 11.79474931, 10.82819307f, 11.01369307f, 11.34469307f, 11.79569307f, - 12.28044307, 12.59644307f, 13.08119307f, 13.53219307f, 13.86319307f, 14.04869307, 12.38512037f, 12.57062037f, - 12.90162037f, 13.35262037f, 13.83737037, 14.15337037f, 14.63812037f, 15.08912037f, 15.42012037f, 15.60562037, - 13.32442078f, 13.50992078f, 13.84092078f, 14.29192078f, 14.77667078, 15.09267078f, 15.57742078f, 16.02842078f, - 16.35942078f, 16.54492078}); + 12.28044307, 12.59644307f, 13.08119307f, 13.53219307f, 13.86319307f, 14.04869307f, 12.38512037f, 12.57062037f, + 12.90162037f, 13.35262037f, 13.83737037f, 14.15337037f, 14.63812037f, 15.08912037f, 15.42012037f, 15.60562037f, + 13.32442078f, 13.50992078f, 13.84092078f, 14.29192078f, 14.77667078f, 15.09267078f, 15.57742078f, 16.02842078f, + 16.35942078f, 16.54492078f}); test_case.run_with_tolerance_as_fp(2.0e-5f); } @@ -2507,7 +2507,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_argmax_float) { file_util::path_join(CommonTestUtils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/argmax_float.onnx")); auto test_case = test::TestCase(function, s_device); - test_case.add_input({4, 0.1, 2, 3, -3, 1, -0.9, 0, 1, 2, 3, 0}); + test_case.add_input({4.f, 0.1f, 2.f, 3.f, -3.f, 1.f, -0.9f, 0.f, 1.f, 2.f, 3.f, 0.f}); test_case.add_expected_output({0, 3, 0}); test_case.run(); } @@ -2517,7 +2517,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_argmin_float) { file_util::path_join(CommonTestUtils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/argmin_float.onnx")); auto test_case = test::TestCase(function, s_device); - test_case.add_input({4, 0.1, 2, 3, -3, 1, -0.9, 0, 1, 2, 3, 0}); + test_case.add_input({4.f, 0.1f, 2.f, 3.f, -3.f, 1.f, -0.9f, 0.f, 1.f, 2.f, 3.f, 0.f}); test_case.add_expected_output({1, 1, 0, 2}); test_case.run(); } @@ -2528,7 +2528,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_argmax_select_last_index) { "onnx/argmax_select_last_index.onnx")); auto test_case = test::TestCase(function, s_device); - test_case.add_input(Shape{4, 3}, {1, 1, 1, 0.5, 3, 4, 0.5, 1, 1.1, 0, 3, 0}); + test_case.add_input(Shape{4, 3}, {1.f, 1.f, 1.f, 0.5f, 3.f, 4.f, 0.5f, 1.f, 1.1f, 0.f, 3.f, 0.f}); test_case.add_expected_output(Shape{1, 3}, {0, 3, 1}); test_case.run(); } @@ -2539,7 +2539,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_argmin_select_last_index) { "onnx/argmin_select_last_index.onnx")); auto test_case = test::TestCase(function, s_device); - test_case.add_input(Shape{4, 3}, {1, 1, 1, 2, 3, 4, 2, 1, 1.1, 3, 3, 8}); + test_case.add_input(Shape{4, 3}, {1.f, 1.f, 1.f, 2.f, 3.f, 4.f, 2.f, 1.f, 1.1f, 3.f, 3.f, 8.f}); test_case.add_expected_output(Shape{4}, {2, 0, 1, 1}); test_case.run(); } @@ -3122,8 +3122,8 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_mod_sign_fmod_f32) { file_util::path_join(CommonTestUtils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/mod_sign_fmod_f32.onnx")); auto test_case = test::TestCase(function, s_device); - test_case.add_input({-4.3, 7.2, 5.0, 4.3, -7.2, 8.0}); - test_case.add_input({2.1, -3.4, 8.0, -2.1, 3.4, 5.0}); + test_case.add_input({-4.3f, 7.2f, 5.0f, 4.3f, -7.2f, 8.0f}); + test_case.add_input({2.1f, -3.4f, 8.0f, -2.1f, 3.4f, 5.0f}); test_case.add_expected_output(Shape{6}, {-0.10000038f, 0.39999962f, 5.f, 0.10000038f, -0.39999962f, 3.f}); test_case.run(); @@ -5167,10 +5167,10 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_aten_embedding_bag_packed_sum_4in_two_none) { "onnx/aten_embedding_sum_packed_4in_two_none.onnx")); auto test_case = test::TestCase(function, s_device); - test_case.add_input(Shape{5, 2}, {-0.2, -0.6, -0.1, -0.4, -1.9, -1.8, -1., 1.5, 0.8, -0.7}); + test_case.add_input(Shape{5, 2}, {-0.2f, -0.6f, -0.1f, -0.4f, -1.9f, -1.8f, -1.f, 1.5f, 0.8f, -0.7f}); test_case.add_input(Shape{3, 2}, {0, 2, 1, 2, 3, 4}); // indices - test_case.add_expected_output(Shape{3, 2}, {-2.1, -2.4, -2., -2.2, -0.19999999, 0.8}); + test_case.add_expected_output(Shape{3, 2}, {-2.1f, -2.4f, -2.f, -2.2f, -0.19999999f, 0.8f}); test_case.run(); } @@ -5185,7 +5185,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_aten_embedding_bag_offsets_sum_3in) { test_case.add_input(Shape{4}, {0, 2, 3, 4}); // indices test_case.add_input(Shape{3}, {0, 2, 2}); // offsets - test_case.add_expected_output(Shape{3, 2}, {-2.1, -2.4, 0, 0, -0.2, 0.8}); + test_case.add_expected_output(Shape{3, 2}, {-2.1f, -2.4f, 0.f, 0.f, -0.2f, 0.8f}); test_case.run(); } @@ -5403,7 +5403,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_scan15_fib_like_input_rev) { test_case.add_expected_output(Shape{}, {0.f}); test_case.add_expected_output( Shape{10}, - {0.9, 1.52, 1.694, 1.9284, 1.8112, 1.4958401, 0.9921121, 0.49759045, 0.14897026, 0.}); + {0.9f, 1.52f, 1.694f, 1.9284f, 1.8112f, 1.4958401f, 0.9921121f, 0.49759045f, 0.14897026f, 0.f}); test_case.run(); } @@ -6245,7 +6245,7 @@ NGRAPH_TEST(${BACKEND_NAME}, castlike_float16_to_uint32) { auto test_case = test::TestCase(function, s_device); - test_case.add_input(Shape{1, 1, 2, 2}, std::vector{1.5, 2.3, 3, 4}); + test_case.add_input(Shape{1, 1, 2, 2}, std::vector{1.5f, 2.3f, 3.f, 4.f}); test_case.add_input(Shape{4}, {1, 2, 3, 4}); test_case.add_expected_output(std::vector{1, 2, 3, 4}); @@ -6259,7 +6259,7 @@ NGRAPH_TEST(${BACKEND_NAME}, castlike_float16_to_int64) { auto test_case = test::TestCase(function, s_device); - test_case.add_input(Shape{1, 1, 2, 2}, std::vector{1.5, 2.3, 3, 4}); + test_case.add_input(Shape{1, 1, 2, 2}, std::vector{1.5f, 2.3f, 3.f, 4.f}); test_case.add_input(Shape{4}, {1, 2, 3, 4}); test_case.add_expected_output(std::vector{1, 2, 3, 4}); @@ -6346,8 +6346,10 @@ NGRAPH_TEST(${BACKEND_NAME}, DISABLED_castlike_float32_to_bfloat16) { test_case.add_input( Shape{3, 4}, std::vector{121.5f, 122.7f, 3.f, 4.f, 5.f, 6.f, 7.f, 8.8f, 9.f, 10.f, 11.f, 12.f}); - test_case.add_input(Shape{3, 4}, {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}); - test_case.add_expected_output(std::vector{121.5, 122.7, 3, 4, 5, 6, 7, 8.8, 9, 10, 11, 12}); + test_case.add_input(Shape{3, 4}, + {1.5f, 2.5f, 3.5f, 4.5f, 5.5f, 6.5f, 7.5f, 8.5f, 9.5f, 10.5f, 11.5f, 12.5f}); + test_case.add_expected_output( + std::vector{121.5f, 122.7f, 3.f, 4.f, 5.f, 6.f, 7.f, 8.8f, 9.f, 10.f, 11.f, 12.f}); test_case.run(); } @@ -6359,9 +6361,12 @@ NGRAPH_TEST(${BACKEND_NAME}, DISABLED_castlike_bfloat16_to_float32) { auto test_case = test::TestCase(function, s_device); - test_case.add_input(Shape{3, 4}, std::vector{121.5, 122.7, 3, 4, 5, 6, 7, 8.8, 9, 10, 11, 12}); + test_case.add_input( + Shape{3, 4}, + std::vector{121.5f, 122.7f, 3.f, 4.f, 5.f, 6.f, 7.f, 8.8f, 9.f, 10.f, 11.f, 12.f}); test_case.add_input(Shape{3, 4}, {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}); - test_case.add_expected_output(std::vector{121.5, 122.7, 3, 4, 5, 6, 7, 8.75, 9, 10, 11, 12}); + test_case.add_expected_output( + std::vector{121.5f, 122.7f, 3.f, 4.f, 5.f, 6.f, 7.f, 8.75f, 9.f, 10.f, 11.f, 12.f}); test_case.run(); } diff --git a/src/frontends/onnx/tests/onnx_import_dyn_shapes.in.cpp b/src/frontends/onnx/tests/onnx_import_dyn_shapes.in.cpp index 89e05cb6a9b9f7..1adc51e123bb30 100644 --- a/src/frontends/onnx/tests/onnx_import_dyn_shapes.in.cpp +++ b/src/frontends/onnx/tests/onnx_import_dyn_shapes.in.cpp @@ -713,7 +713,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_transpose) { const auto elems_in_tensor = shape_size(shape); std::vector input_values(elems_in_tensor); - std::iota(std::begin(input_values), std::end(input_values), 1); + std::iota(std::begin(input_values), std::end(input_values), 1.f); test_case.add_input(shape, input_values); diff --git a/src/frontends/onnx/tests/onnx_import_org_pytorch.in.cpp b/src/frontends/onnx/tests/onnx_import_org_pytorch.in.cpp index 110fbe656614de..d57b9c6ad64b32 100644 --- a/src/frontends/onnx/tests/onnx_import_org_pytorch.in.cpp +++ b/src/frontends/onnx/tests/onnx_import_org_pytorch.in.cpp @@ -34,23 +34,23 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_adaptive_avg_pooling2d_nchw) { "onnx/org.pytorch/adaptive_avg_pooling2d_nchw.onnx")); auto test_case = test::TestCase(function, s_device); - test_case.add_input({0.9945, - 0.3466, - 0.2894, - 0.9318, - 0.0115, - 0.4867, - 0.7608, - 0.1550, - 0.8485, - 0.4971, - 0.8833, - 0.4579, - 0.3673, - 0.5410, - 0.2004, - 0.1519}); - test_case.add_expected_output(Shape{1, 1, 2, 2}, {0.4598249, 0.5342500, 0.5634750, 0.4233750}); + test_case.add_input({0.9945f, + 0.3466f, + 0.2894f, + 0.9318f, + 0.0115f, + 0.4867f, + 0.7608f, + 0.1550f, + 0.8485f, + 0.4971f, + 0.8833f, + 0.4579f, + 0.3673f, + 0.5410f, + 0.2004f, + 0.1519f}); + test_case.add_expected_output(Shape{1, 1, 2, 2}, {0.4598249f, 0.5342500f, 0.5634750f, 0.4233750f}); test_case.run(); } @@ -61,8 +61,8 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_adaptive_avg_pooling2d_chw) { "onnx/org.pytorch/adaptive_avg_pooling2d_chw.onnx")); auto test_case = test::TestCase(function, s_device); - test_case.add_input({12.0, -1.0, -56.0, 20.0, 1.0, -8.0, 7.0, 9.0}); + test_case.add_input({12.0f, -1.0f, -56.0f, 20.0f, 1.0f, -8.0f, 7.0f, 9.0f}); - test_case.add_expected_output(Shape{1, 2, 2}, {5.5, -18.0, -3.5, 8.0}); + test_case.add_expected_output(Shape{1, 2, 2}, {5.5f, -18.0f, -3.5f, 8.0f}); test_case.run(); } diff --git a/src/frontends/onnx/tests/onnx_import_rnn.in.cpp b/src/frontends/onnx/tests/onnx_import_rnn.in.cpp index fbe25a2b0b0227..06b28aa76a88e6 100644 --- a/src/frontends/onnx/tests/onnx_import_rnn.in.cpp +++ b/src/frontends/onnx/tests/onnx_import_rnn.in.cpp @@ -39,12 +39,12 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_lstm_fwd_default_const) { "onnx/lstm_fwd_default_const.onnx")); auto test_case = test::TestCase(function, s_device); - test_case.add_input({0.68172926, 1.1405563, -0.03931177, -0.03759607}); // X + test_case.add_input({0.68172926f, 1.1405563f, -0.03931177f, -0.03759607f}); // X test_case.add_expected_output(Shape{2, 1, 1, 2}, - {-0.063373, -0.20347191, -0.07230289, -0.13298286}); // Y_data - test_case.add_expected_output(Shape{1, 1, 2}, {-0.07230289, -0.13298286}); // Y_h_data - test_case.add_expected_output(Shape{1, 1, 2}, {-0.1557954, -0.24502525}); // Y_c_data + {-0.063373f, -0.20347191f, -0.07230289f, -0.13298286f}); // Y_data + test_case.add_expected_output(Shape{1, 1, 2}, {-0.07230289f, -0.13298286f}); // Y_h_data + test_case.add_expected_output(Shape{1, 1, 2}, {-0.1557954f, -0.24502525f}); // Y_c_data test_case.run(DEFAULT_FLOAT_TOLERANCE_BITS + 1); } @@ -55,12 +55,12 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_lstm_reverse_const) { "onnx/lstm_reverse_const.onnx")); auto test_case = test::TestCase(function, s_device); - test_case.add_input({0.68172926, 1.1405563, -0.03931177, -0.03759607}); // X + test_case.add_input({0.68172926f, 1.1405563f, -0.03931177f, -0.03759607f}); // X test_case.add_expected_output(Shape{2, 1, 1, 2}, - {-0.06082131, -0.19985214, 0.00860566, 0.00920492}); // Y_data - test_case.add_expected_output(Shape{1, 1, 2}, {-0.06082131, -0.19985214}); // Y_h_data - test_case.add_expected_output(Shape{1, 1, 2}, {-0.25917438, -0.3832652}); // Y_c_data + {-0.06082131f, -0.19985214f, 0.00860566f, 0.00920492f}); // Y_data + test_case.add_expected_output(Shape{1, 1, 2}, {-0.06082131f, -0.19985214f}); // Y_h_data + test_case.add_expected_output(Shape{1, 1, 2}, {-0.25917438f, -0.3832652f}); // Y_c_data test_case.run(DEFAULT_FLOAT_TOLERANCE_BITS + 1); } @@ -70,21 +70,21 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_lstm_bidir_const) { file_util::path_join(CommonTestUtils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/lstm_bidir_const.onnx")); auto test_case = test::TestCase(function, s_device); - test_case.add_input({0.68172926, 1.1405563, -0.03931177, -0.03759607}); // X + test_case.add_input({0.68172926f, 1.1405563f, -0.03931177f, -0.03759607f}); // X test_case.add_expected_output(Shape{2, 2, 1, 2}, - {-0.063373, - -0.20347191, - -0.06082131, - -0.19985214, - -0.07230289, - -0.13298286, - 0.00860566, - 0.00920492}); // Y_data + {-0.063373f, + -0.20347191f, + -0.06082131f, + -0.19985214f, + -0.07230289f, + -0.13298286f, + 0.00860566f, + 0.00920492f}); // Y_data test_case.add_expected_output(Shape{2, 1, 2}, - {-0.07230289, -0.13298286, -0.06082131, -0.19985214}); // Y_h_data + {-0.07230289f, -0.13298286f, -0.06082131f, -0.19985214f}); // Y_h_data test_case.add_expected_output(Shape{2, 1, 2}, - {-0.1557954, -0.24502525, -0.25917438, -0.3832652}); // Y_c_data + {-0.1557954f, -0.24502525f, -0.25917438f, -0.3832652f}); // Y_c_data test_case.run(DEFAULT_FLOAT_TOLERANCE_BITS + 1); } @@ -95,12 +95,12 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_lstm_fwd_with_clip_const) { "onnx/lstm_fwd_clip_const.onnx")); auto test_case = test::TestCase(function, s_device); - test_case.add_input({0.68172926, 1.1405563, -0.03931177, -0.03759607}); // X + test_case.add_input({0.68172926f, 1.1405563f, -0.03931177f, -0.03759607f}); // X test_case.add_expected_output(Shape{2, 1, 1, 2}, - {-0.02391884, -0.02744377, -0.01024176, -0.01188637}); // Y_data - test_case.add_expected_output(Shape{1, 1, 2}, {-0.01024176, -0.01188637}); // Y_h_data - test_case.add_expected_output(Shape{1, 1, 2}, {-0.02039271, -0.02353566}); // Y_c_data + {-0.02391884f, -0.02744377f, -0.01024176f, -0.01188637f}); // Y_data + test_case.add_expected_output(Shape{1, 1, 2}, {-0.01024176f, -0.01188637f}); // Y_h_data + test_case.add_expected_output(Shape{1, 1, 2}, {-0.02039271f, -0.02353566f}); // Y_c_data test_case.run(DEFAULT_FLOAT_TOLERANCE_BITS + 1); } @@ -111,27 +111,27 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_lstm_fwd_mixed_seq_const) { "onnx/lstm_fwd_mixed_seq_const.onnx")); auto test_case = test::TestCase(function, s_device); - test_case.add_input({0.68172926, 1.1405563, -0.03931177, -0.03759607}); // X + test_case.add_input({0.68172926f, 1.1405563f, -0.03931177f, -0.03759607f}); // X test_case.add_expected_output(Shape{2, 1, 2, 3}, - {0.13528088, - -0.1779867, - -0.07448981, - 0.14769037, - -0.16327181, - -0.10419653, + {0.13528088f, + -0.1779867f, + -0.07448981f, + 0.14769037f, + -0.16327181f, + -0.10419653f, 0., 0., 0., - 0.08759661, - -0.04002844, - -0.08617793}); // Y_data + 0.08759661f, + -0.04002844f, + -0.08617793f}); // Y_data test_case.add_expected_output( Shape{1, 2, 3}, - {0.13528088, -0.1779867, -0.07448981, 0.08759661, -0.04002844, -0.08617793}); // Y_h_data + {0.13528088f, -0.1779867f, -0.07448981f, 0.08759661f, -0.04002844f, -0.08617793f}); // Y_h_data test_case.add_expected_output( Shape{1, 2, 3}, - {0.367563, -0.43762812, -0.20435227, 0.17330585, -0.0732716, -0.18809439}); // Y_c_data + {0.367563f, -0.43762812f, -0.20435227f, 0.17330585f, -0.0732716f, -0.18809439f}); // Y_c_data test_case.run(DEFAULT_FLOAT_TOLERANCE_BITS + 1); } @@ -142,27 +142,27 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_lstm_reverse_mixed_seq_const) { "onnx/lstm_reverse_mixed_seq_const.onnx")); auto test_case = test::TestCase(function, s_device); - test_case.add_input({0.68172926, 1.1405563, -0.03931177, -0.03759607}); // X + test_case.add_input({0.68172926f, 1.1405563f, -0.03931177f, -0.03759607f}); // X test_case.add_expected_output(Shape{2, 1, 2, 3}, - {0.13528088, - -0.1779867, - -0.07448981, - 0.14696799, - -0.15571019, - -0.10270946, + {0.13528088f, + -0.1779867f, + -0.07448981f, + 0.14696799f, + -0.15571019f, + -0.10270946f, 0., 0., 0., - -0.01110403, - 0.0228607, - 0.00397353}); // Y_data + -0.01110403f, + 0.0228607f, + 0.00397353f}); // Y_data test_case.add_expected_output( Shape{1, 2, 3}, - {0.13528088, -0.1779867, -0.07448981, 0.14696799, -0.15571019, -0.10270946}); // Y_h_data + {0.13528088f, -0.1779867f, -0.07448981f, 0.14696799f, -0.15571019f, -0.10270946f}); // Y_h_data test_case.add_expected_output( Shape{1, 2, 3}, - {0.367563, -0.43762812, -0.20435227, 0.50598085, -0.42627674, -0.3641275}); // Y_c_data + {0.367563f, -0.43762812f, -0.20435227f, 0.50598085f, -0.42627674f, -0.3641275f}); // Y_c_data test_case.run(DEFAULT_FLOAT_TOLERANCE_BITS + 1); } @@ -174,43 +174,43 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_lstm_bidir_mixed_seq_const) { auto test_case = test::TestCase(function, s_device); test_case.add_input( - {0.68172926, 1.1405563, -0.03931177, -0.03759607, 1.1397027, 0.60444903, 1.3246384, -0.28191715}); // X + {0.68172926f, 1.1405563f, -0.03931177f, -0.03759607f, 1.1397027f, 0.60444903f, 1.3246384f, -0.28191715f}); // X test_case.add_expected_output(Shape{2, 2, 2, 2}, - {-0.063373, - -0.20347191, - 0.00860566, - 0.00920492, - -0.063373, - -0.20347191, - -0.12004475, - -0.12800421, + {-0.063373f, + -0.20347191f, + 0.00860566f, + 0.00920492f, + -0.063373f, + -0.20347191f, + -0.12004475f, + -0.12800421f, 0., 0., - -0.19095606, - -0.12459831, + -0.19095606f, + -0.12459831f, 0., 0., - -0.1911628, - -0.12813942}); // Y_data + -0.1911628f, + -0.12813942f}); // Y_data test_case.add_expected_output(Shape{2, 2, 2}, - {-0.063373, - -0.20347191, - -0.19095606, - -0.12459831, - -0.063373, - -0.20347191, - -0.12004475, - -0.12800421}); // Y_h_data + {-0.063373f, + -0.20347191f, + -0.19095606f, + -0.12459831f, + -0.063373f, + -0.20347191f, + -0.12004475f, + -0.12800421f}); // Y_h_data test_case.add_expected_output(Shape{2, 2, 2}, - {-0.2732999, - -0.38956356, - -0.48170844, - -0.34701264, - -0.2732999, - -0.38956356, - -0.27130172, - -0.253659}); // Y_c_data + {-0.2732999f, + -0.38956356f, + -0.48170844f, + -0.34701264f, + -0.2732999f, + -0.38956356f, + -0.27130172f, + -0.253659f}); // Y_c_data test_case.run(DEFAULT_FLOAT_TOLERANCE_BITS + 1); } @@ -221,8 +221,8 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_lstm_fwd_with_clip_peepholes) { "onnx/lstm_fwd_with_clip_peepholes.onnx")); auto test_case = test::TestCase(function, s_device); - test_case.add_input({-0.455351, -0.276391, -0.185934, -0.269585}); // X - test_case.add_input({-0.494659f, // W + test_case.add_input({-0.455351f, -0.276391f, -0.185934f, -0.269585f}); // X + test_case.add_input({-0.494659f, // W 0.0453352f, -0.487793f, 0.417264f, @@ -560,10 +560,10 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_lstm_dynamic_batch_size_and_seq_len) { test_case.add_input({1, 2, 3, 4, 5, 6}); test_case.add_expected_output(Shape{1, 1, 3, 2}, - {0.761594, 0.761594, 0.761594, 0.761594, 0.761594, 0.761594}); // Y + {0.761594f, 0.761594f, 0.761594f, 0.761594f, 0.761594f, 0.761594f}); // Y test_case.add_expected_output(Shape{1, 3, 2}, - {0.761594, 0.761594, 0.761594, 0.761594, 0.761594, 0.761594}); // Y_c - test_case.add_expected_output(Shape{1, 3, 2}, {1, 1, 1, 1, 1, 1}); // Y_h + {0.761594f, 0.761594f, 0.761594f, 0.761594f, 0.761594f, 0.761594f}); // Y_c + test_case.add_expected_output(Shape{1, 3, 2}, {1, 1, 1, 1, 1, 1}); // Y_h test_case.run(DEFAULT_FLOAT_TOLERANCE_BITS + 1); } @@ -769,32 +769,32 @@ NGRAPH_TEST_F(${BACKEND_NAME}, GRUSequenceOp, onnx_model_gru_fwd_activations_con // Y test_case.add_expected_output( Shape{4, 1, 3, 5}, - std::vector{0.30736187, 0.10271017, 0.91698503, 0.3471303, -0.0123809, 0.51264125, 0.51235366, - 0.45471948, 0.50601995, 0.49260828, 0.4781971, 0.0668709, 0.89421916, 0.33762455, - -0.19021586, 0.6881336, 0.7331965, 0.8887774, 0.34048334, 0.38408905, 0.49962956, - 0.2948451, 0.3651103, 0.33406913, 0.57418096, 0.49882296, 0.4321446, 0.97142136, - 0.20714557, 0.66270787, 0.53192705, 0.46424377, 0.9647801, 0.19583187, 0.7362316, - 0.48205143, -0.04748845, 0.27395952, 0.35897565, 0.5801568, 0.5889811, 0.36110958, - 1.3433081, 0.29702073, 0.5709667, 0.936689, 0.84129435, 1.1782551, 0.23925206, - 0.57521456, 0.43502977, -0.5664091, 0.6758457, 0.2958132, 0.70932186, 0.4411352, - -0.1717428, 1.7761463, 0.14413449, 0.73801273}); + std::vector{0.30736187f, 0.10271017f, 0.91698503f, 0.3471303f, -0.0123809f, 0.51264125f, 0.51235366f, + 0.45471948f, 0.50601995f, 0.49260828f, 0.4781971f, 0.0668709f, 0.89421916f, 0.33762455f, + -0.19021586f, 0.6881336f, 0.7331965f, 0.8887774f, 0.34048334f, 0.38408905f, 0.49962956f, + 0.2948451f, 0.3651103f, 0.33406913f, 0.57418096f, 0.49882296f, 0.4321446f, 0.97142136f, + 0.20714557f, 0.66270787f, 0.53192705f, 0.46424377f, 0.9647801f, 0.19583187f, 0.7362316f, + 0.48205143f, -0.04748845f, 0.27395952f, 0.35897565f, 0.5801568f, 0.5889811f, 0.36110958f, + 1.3433081f, 0.29702073f, 0.5709667f, 0.936689f, 0.84129435f, 1.1782551f, 0.23925206f, + 0.57521456f, 0.43502977f, -0.5664091f, 0.6758457f, 0.2958132f, 0.70932186f, 0.4411352f, + -0.1717428f, 1.7761463f, 0.14413449f, 0.73801273f}); // Y_h test_case.add_expected_output(Shape{1, 3, 5}, - std::vector{0.936689, - 0.84129435, - 1.1782551, - 0.23925206, - 0.57521456, - 0.43502977, - -0.5664091, - 0.6758457, - 0.2958132, - 0.70932186, - 0.4411352, - -0.1717428, - 1.7761463, - 0.14413449, - 0.73801273}); + std::vector{0.936689f, + 0.84129435f, + 1.1782551f, + 0.23925206f, + 0.57521456f, + 0.43502977f, + -0.5664091f, + 0.6758457f, + 0.2958132f, + 0.70932186f, + 0.4411352f, + -0.1717428f, + 1.7761463f, + 0.14413449f, + 0.73801273f}); test_case.run(DEFAULT_FLOAT_TOLERANCE_BITS + 5); } @@ -908,32 +908,33 @@ NGRAPH_TEST_F(${BACKEND_NAME}, GRUSequenceOp, onnx_model_gru_fwd_mixed_seq_len_c // Y test_case.add_expected_output( Shape{4, 1, 3, 5}, - std::vector{-0.9559332, 0.4372494, 0.9967716, -0.9079381, -1.2538278, 1.9265908, -0.8437393, - -1.2057271, -0.25887525, -0.52679026, -0.3619178, 0.67928517, 0.9486744, -0.12006134, - -1.3862017, -0.98941356, 0.80389524, 0.97586197, -0.9343586, -0.74858856, 1.797039, - -0.7873732, -0.72469383, -0.5866635, -0.42103744, -0.8406298, 0.85877097, 0.6349921, - -0.55897295, -0.6168443, 0., 0., 0., 0., 0., - 1.577129, -0.6935871, -0.304804, -0.75392795, -0.20703818, -0.93796504, 0.9220495, - 0.36017662, -0.7007159, 0.06962098, 0., 0., 0., 0., - 0., 0., 0., 0., 0., 0., -0.96323603, - 0.9265786, 0.54976916, -0.8037839, 0.73501444}); + std::vector{-0.9559332f, 0.4372494f, 0.9967716f, -0.9079381f, -1.2538278f, 1.9265908f, + -0.8437393f, -1.2057271f, -0.25887525f, -0.52679026f, -0.3619178f, 0.67928517f, + 0.9486744f, -0.12006134f, -1.3862017f, -0.98941356f, 0.80389524f, 0.97586197f, + -0.9343586f, -0.74858856f, 1.797039f, -0.7873732f, -0.72469383f, -0.5866635f, + -0.42103744f, -0.8406298f, 0.85877097f, 0.6349921f, -0.55897295f, -0.6168443f, + 0., 0., 0., 0., 0., 1.577129f, + -0.6935871f, -0.304804f, -0.75392795f, -0.20703818f, -0.93796504f, 0.9220495f, + 0.36017662f, -0.7007159f, 0.06962098f, 0., 0., 0., + 0., 0., 0., 0., 0., 0., + 0., -0.96323603f, 0.9265786f, 0.54976916f, -0.8037839f, 0.73501444f}); // Y_h test_case.add_expected_output(Shape{1, 3, 5}, - std::vector{-0.98941356, - 0.80389524, - 0.97586197, - -0.9343586, - -0.74858856, - 1.577129, - -0.6935871, - -0.304804, - -0.75392795, - -0.20703818, - -0.96323603, - 0.9265786, - 0.54976916, - -0.8037839, - 0.73501444}); + std::vector{-0.98941356f, + 0.80389524f, + 0.97586197f, + -0.9343586f, + -0.74858856f, + 1.577129f, + -0.6935871f, + -0.304804f, + -0.75392795f, + -0.20703818f, + -0.96323603f, + 0.9265786f, + 0.54976916f, + -0.8037839f, + 0.73501444f}); test_case.run(DEFAULT_FLOAT_TOLERANCE_BITS + 3); } @@ -949,32 +950,33 @@ NGRAPH_TEST_F(${BACKEND_NAME}, GRUSequenceOp, onnx_model_gru_reverse_mixed_seq_l // Y test_case.add_expected_output( Shape{4, 1, 3, 5}, - std::vector{-0.9917215, 0.07583051, 0.997975, -0.9315585, -0.7483002, 1.536813, -0.59922504, - -0.33637103, -0.7565539, -0.23930266, -0.7844553, 1.0393485, 0.73516595, -0.5616293, - -0.09489207, -0.9501128, 0.7905356, 0.9928266, -0.9153729, -1.1781745, 1.7955453, - -0.77754307, -0.6831806, -0.6266324, -0.39791372, -0.8030517, 1.3107346, 0.3700709, - -0.49808976, 0.52939236, 0., 0., 0., 0., 0., - 1.9345565, -0.83817405, -1.1433047, -0.35640514, -0.5191339, -0.655544, 1.3520991, - 0.42289692, -0.3171452, -0.3922639, 0., 0., 0., 0., - 0., 0., 0., 0., 0., 0., -0.24612205, - 1.6415757, 0.79883975, -0.18640287, -1.0134869}); + std::vector{-0.9917215f, 0.07583051f, 0.997975f, -0.9315585f, -0.7483002f, 1.536813f, + -0.59922504f, -0.33637103f, -0.7565539f, -0.23930266f, -0.7844553f, 1.0393485f, + 0.73516595f, -0.5616293f, -0.09489207f, -0.9501128f, 0.7905356f, 0.9928266f, + -0.9153729f, -1.1781745f, 1.7955453f, -0.77754307f, -0.6831806f, -0.6266324f, + -0.39791372f, -0.8030517f, 1.3107346f, 0.3700709f, -0.49808976f, 0.52939236f, + 0., 0., 0., 0., 0., 1.9345565f, + -0.83817405f, -1.1433047f, -0.35640514f, -0.5191339f, -0.655544f, 1.3520991f, + 0.42289692f, -0.3171452f, -0.3922639f, 0., 0., 0., + 0., 0., 0., 0., 0., 0., + 0., -0.24612205f, 1.6415757f, 0.79883975f, -0.18640287f, -1.0134869f}); // Y_h test_case.add_expected_output(Shape{1, 3, 5}, - std::vector{-0.9917215, - 0.07583051, - 0.997975, - -0.9315585, - -0.7483002, - 1.536813, - -0.59922504, - -0.33637103, - -0.7565539, - -0.23930266, - -0.7844553, - 1.0393485, - 0.73516595, - -0.5616293, - -0.09489207}); + std::vector{-0.9917215f, + 0.07583051f, + 0.997975f, + -0.9315585f, + -0.7483002f, + 1.536813f, + -0.59922504f, + -0.33637103f, + -0.7565539f, + -0.23930266f, + -0.7844553f, + 1.0393485f, + 0.73516595f, + -0.5616293f, + -0.09489207f}); test_case.run(DEFAULT_FLOAT_TOLERANCE_BITS + 3); } @@ -991,29 +993,32 @@ NGRAPH_TEST_F(${BACKEND_NAME}, GRUSequenceOp, onnx_model_gru_bidir_mixed_seq_len test_case.add_expected_output( Shape{4, 2, 3, 5}, std::vector{ - -0.3224981, -0.44282594, 0.7499796, -0.12240417, 0.12079421, 0.02534254, 0.02504561, -0.0463777, - 0.01204535, -0.01497037, -0.04651929, -0.6264307, 0.7236632, 0.06250653, 0.02594197, 0.0595789, - 0.40258542, -0.40646964, 0.70320284, -0.02962421, 0.10372428, -0.38378227, -0.4331268, -0.15696645, - -0.3451503, 0.20918667, -0.59024405, -0.845524, 0.60705113, -0.6336088, -0.0833023, -0.40062034, - 0.7579466, -0.12340625, 0.04415433, -0.24662054, 0.27420586, -0.09122991, -0.22768986, 0.19980887, - -0.218649, -0.5560231, 0.56177044, -0.25098884, 0.15462328, 0.0409361, 0.17866893, -0.2782218, - 0.27396634, -0.04992082, 0.15353821, -0.4497267, -0.44631857, -0.478926, -0.23017275, 0.25369287, - -0.7369056, -0.73285, -0.5750758, -0.533177, 0., 0., 0., 0., - 0., -0.45753813, 0.5987347, -0.07046632, -0.35819566, 0.3916747, -0.18096107, -0.24415034, - 0.38435352, -0.29881003, 0.07738188, 0., 0., 0., 0., 0., - 0.10390212, -0.29646862, -0.20532897, -0.31521815, 0.01049522, 0.19370168, -0.6386781, -0.42919028, - -0.47081998, -0.2954276, 0., 0., 0., 0., 0., 0., - 0., 0., 0., 0., -0.50112087, -0.11085765, 0.5155622, -0.5635352, - 0.54762024, 0., 0., 0., 0., 0., 0., 0., - 0., 0., 0., 0.17058733, -0.6941011, -0.27862304, -0.27050856, -0.03864266}); + -0.3224981f, -0.44282594f, 0.7499796f, -0.12240417f, 0.12079421f, 0.02534254f, 0.02504561f, + -0.0463777f, 0.01204535f, -0.01497037f, -0.04651929f, -0.6264307f, 0.7236632f, 0.06250653f, + 0.02594197f, 0.0595789f, 0.40258542f, -0.40646964f, 0.70320284f, -0.02962421f, 0.10372428f, + -0.38378227f, -0.4331268f, -0.15696645f, -0.3451503f, 0.20918667f, -0.59024405f, -0.845524f, + 0.60705113f, -0.6336088f, -0.0833023f, -0.40062034f, 0.7579466f, -0.12340625f, 0.04415433f, + -0.24662054f, 0.27420586f, -0.09122991f, -0.22768986f, 0.19980887f, -0.218649f, -0.5560231f, + 0.56177044f, -0.25098884f, 0.15462328f, 0.0409361f, 0.17866893f, -0.2782218f, 0.27396634f, + -0.04992082f, 0.15353821f, -0.4497267f, -0.44631857f, -0.478926f, -0.23017275f, 0.25369287f, + -0.7369056f, -0.73285f, -0.5750758f, -0.533177f, 0., 0., 0., + 0., 0., -0.45753813f, 0.5987347f, -0.07046632f, -0.35819566f, 0.3916747f, + -0.18096107f, -0.24415034f, 0.38435352f, -0.29881003f, 0.07738188f, 0., 0., + 0., 0., 0., 0.10390212f, -0.29646862f, -0.20532897f, -0.31521815f, + 0.01049522f, 0.19370168f, -0.6386781f, -0.42919028f, -0.47081998f, -0.2954276f, 0., + 0., 0., 0., 0., 0., 0., 0., + 0., 0., -0.50112087f, -0.11085765f, 0.5155622f, -0.5635352f, 0.54762024f, + 0., 0., 0., 0., 0., 0., 0., + 0., 0., 0., 0.17058733f, -0.6941011f, -0.27862304f, -0.27050856f, + -0.03864266f}); // Y_h test_case.add_expected_output( Shape{2, 3, 5}, - std::vector{-0.0833023, -0.40062034, 0.7579466, -0.12340625, 0.04415433, -0.45753813, - 0.5987347, -0.07046632, -0.35819566, 0.3916747, -0.50112087, -0.11085765, - 0.5155622, -0.5635352, 0.54762024, 0.0595789, 0.40258542, -0.40646964, - 0.70320284, -0.02962421, 0.10372428, -0.38378227, -0.4331268, -0.15696645, - -0.3451503, 0.20918667, -0.59024405, -0.845524, 0.60705113, -0.6336088}); + std::vector{-0.0833023f, -0.40062034f, 0.7579466f, -0.12340625f, 0.04415433f, -0.45753813f, + 0.5987347f, -0.07046632f, -0.35819566f, 0.3916747f, -0.50112087f, -0.11085765f, + 0.5155622f, -0.5635352f, 0.54762024f, 0.0595789f, 0.40258542f, -0.40646964f, + 0.70320284f, -0.02962421f, 0.10372428f, -0.38378227f, -0.4331268f, -0.15696645f, + -0.3451503f, 0.20918667f, -0.59024405f, -0.845524f, 0.60705113f, -0.6336088f}); test_case.run(DEFAULT_FLOAT_TOLERANCE_BITS + 4); } @@ -1901,32 +1906,32 @@ NGRAPH_TEST_F(${BACKEND_NAME}, RNNSequenceOp, onnx_model_rnn_reverse_mixed_seq_l // Y test_case.add_expected_output( Shape{4, 1, 3, 5}, - std::vector{-0.27398264, 0.96948624, 0.26404798, 0.8068119, 0.99935544, 0.73694086, 0.44305325, - -0.9964632, 0.7063714, 0.9999049, -0.7241098, 0.08538079, -0.785874, 0.60833323, - 0.99999666, 0.53703666, 0.0267657, 0.37151086, -0.68740594, 0.9992448, 0.3254757, - 0.7716811, -0.9996745, 0.9957807, 0.9995338, 0.9997339, 0.9888724, -0.8992324, - -0.797282, 0.98666525, 0., 0., 0., 0., 0., - 0.95711637, -0.8986079, -0.99998885, 0.96265936, 0.9380511, -0.86523867, 0.3528558, - -0.99675506, 0.946875, 0.79539406, 0., 0., 0., 0., - 0., 0., 0., 0., 0., 0., 0.99903, - 0.9998094, 0.9499353, 0.6077225, -0.9921822}); + std::vector{ + -0.27398264f, 0.96948624f, 0.26404798f, 0.8068119f, 0.99935544f, 0.73694086f, 0.44305325f, -0.9964632f, + 0.7063714f, 0.9999049f, -0.7241098f, 0.08538079f, -0.785874f, 0.60833323f, 0.99999666f, 0.53703666f, + 0.0267657f, 0.37151086f, -0.68740594f, 0.9992448f, 0.3254757f, 0.7716811f, -0.9996745f, 0.9957807f, + 0.9995338f, 0.9997339f, 0.9888724f, -0.8992324f, -0.797282f, 0.98666525f, 0., 0., + 0., 0., 0., 0.95711637f, -0.8986079f, -0.99998885f, 0.96265936f, 0.9380511f, + -0.86523867f, 0.3528558f, -0.99675506f, 0.946875f, 0.79539406f, 0., 0., 0., + 0., 0., 0., 0., 0., 0., 0., 0.99903f, + 0.9998094f, 0.9499353f, 0.6077225f, -0.9921822f}); // Y_h test_case.add_expected_output(Shape{1, 3, 5}, - std::vector{-0.27398264, - 0.96948624, - 0.26404798, - 0.8068119, - 0.99935544, - 0.73694086, - 0.44305325, - -0.9964632, - 0.7063714, - 0.9999049, - -0.7241098, - 0.08538079, - -0.785874, - 0.60833323, - 0.99999666}); + std::vector{-0.27398264f, + 0.96948624f, + 0.26404798f, + 0.8068119f, + 0.99935544f, + 0.73694086f, + 0.44305325f, + -0.9964632f, + 0.7063714f, + 0.9999049f, + -0.7241098f, + 0.08538079f, + -0.785874f, + 0.60833323f, + 0.99999666f}); test_case.run(DEFAULT_FLOAT_TOLERANCE_BITS + 4); } @@ -1942,29 +1947,32 @@ NGRAPH_TEST_F(${BACKEND_NAME}, RNNSequenceOp, onnx_model_rnn_bidir_mixed_seq_len test_case.add_expected_output( Shape{4, 2, 3, 5}, std::vector{ - 0.02254748, 0.15776646, -0.8229023, 0.19205809, 0.76984656, -0.00603169, -0.0286147, 0.04512155, - -0.0011912, -0.02572936, -0.13703543, -0.49651444, -0.78868157, 0.3566854, 0.8758509, -0.99602485, - -0.8151508, -0.5803147, 0.4985683, 0.30210292, 0.11550081, -0.30236644, 0.99622667, -0.8732492, - -0.43772405, -0.9284624, -0.5595875, 0.9986867, -0.18373811, 0.8451735, -0.43823165, -0.1904698, - 0.8320786, 0.9830735, 0.61861455, 0.19109797, 0.64407, 0.00962067, -0.32752877, -0.5050589, - -0.23455954, 0.9517933, 0.9050665, 0.91091585, -0.77941567, -0.71390504, -0.24422187, -0.38115412, - 0.3462553, 0.44084883, -0.81455964, -0.23556596, 0.85043025, -0.7840209, -0.82087713, -0.8349008, - -0.7880142, 0.99017143, -0.9816452, -0.93827677, 0., 0., 0., 0., - 0., 0.28117967, 0.20685148, 0.01166701, -0.5441828, -0.5463747, -0.85301256, 0.52109087, - -0.8317892, -0.9676957, -0.30258918, 0., 0., 0., 0., 0., - -0.7010546, -0.3106169, -0.04788882, -0.21822351, -0.33518708, -0.9073148, 0.16276085, 0.9518349, - -0.8635942, -0.92539954, 0., 0., 0., 0., 0., 0., - 0., 0., 0., 0., 0.9948462, -0.6242633, -0.19065344, -0.36072153, - -0.99407107, 0., 0., 0., 0., 0., 0., 0., - 0., 0., 0., -0.9957684, -0.7924, -0.40261805, -0.34061068, -0.55580306}); + 0.02254748f, 0.15776646f, -0.8229023f, 0.19205809f, 0.76984656f, -0.00603169f, -0.0286147f, + 0.04512155f, -0.0011912f, -0.02572936f, -0.13703543f, -0.49651444f, -0.78868157f, 0.3566854f, + 0.8758509f, -0.99602485f, -0.8151508f, -0.5803147f, 0.4985683f, 0.30210292f, 0.11550081f, + -0.30236644f, 0.99622667f, -0.8732492f, -0.43772405f, -0.9284624f, -0.5595875f, 0.9986867f, + -0.18373811f, 0.8451735f, -0.43823165f, -0.1904698f, 0.8320786f, 0.9830735f, 0.61861455f, + 0.19109797f, 0.64407f, 0.00962067f, -0.32752877f, -0.5050589f, -0.23455954f, 0.9517933f, + 0.9050665f, 0.91091585f, -0.77941567f, -0.71390504f, -0.24422187f, -0.38115412f, 0.3462553f, + 0.44084883f, -0.81455964f, -0.23556596f, 0.85043025f, -0.7840209f, -0.82087713f, -0.8349008f, + -0.7880142f, 0.99017143f, -0.9816452f, -0.93827677f, 0., 0., 0., + 0., 0., 0.28117967f, 0.20685148f, 0.01166701f, -0.5441828f, -0.5463747f, + -0.85301256f, 0.52109087f, -0.8317892f, -0.9676957f, -0.30258918f, 0., 0., + 0., 0., 0., -0.7010546f, -0.3106169f, -0.04788882f, -0.21822351f, + -0.33518708f, -0.9073148f, 0.16276085f, 0.9518349f, -0.8635942f, -0.92539954f, 0., + 0., 0., 0., 0., 0., 0., 0., + 0., 0., 0.9948462f, -0.6242633f, -0.19065344f, -0.36072153f, -0.99407107f, + 0., 0., 0., 0., 0., 0., 0., + 0., 0., 0., -0.9957684f, -0.7924f, -0.40261805f, -0.34061068f, + -0.55580306f}); // Y_h test_case.add_expected_output( Shape{2, 3, 5}, - std::vector{-0.43823165, -0.1904698, 0.8320786, 0.9830735, 0.61861455, 0.28117967, - 0.20685148, 0.01166701, -0.5441828, -0.5463747, 0.9948462, -0.6242633, - -0.19065344, -0.36072153, -0.99407107, -0.99602485, -0.8151508, -0.5803147, - 0.4985683, 0.30210292, 0.11550081, -0.30236644, 0.99622667, -0.8732492, - -0.43772405, -0.9284624, -0.5595875, 0.9986867, -0.18373811, 0.8451735}); + std::vector{-0.43823165f, -0.1904698f, 0.8320786f, 0.9830735f, 0.61861455f, 0.28117967f, + 0.20685148f, 0.01166701f, -0.5441828f, -0.5463747f, 0.9948462f, -0.6242633f, + -0.19065344f, -0.36072153f, -0.99407107f, -0.99602485f, -0.8151508f, -0.5803147f, + 0.4985683f, 0.30210292f, 0.11550081f, -0.30236644f, 0.99622667f, -0.8732492f, + -0.43772405f, -0.9284624f, -0.5595875f, 0.9986867f, -0.18373811f, 0.8451735f}); // loosest match @ mantissa bit: // 16 or next bit (0.01166688557714223862 vs 0.01166701037436723709) From faf8f29f899238652e68ab224610d14eecbd27e2 Mon Sep 17 00:00:00 2001 From: Mateusz Bencer Date: Thu, 16 Mar 2023 18:18:58 +0100 Subject: [PATCH 14/28] fix float cast in iota --- src/frontends/onnx/tests/onnx_import_reshape.in.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontends/onnx/tests/onnx_import_reshape.in.cpp b/src/frontends/onnx/tests/onnx_import_reshape.in.cpp index d75c0a3b57b992..33f71a945b9d78 100644 --- a/src/frontends/onnx/tests/onnx_import_reshape.in.cpp +++ b/src/frontends/onnx/tests/onnx_import_reshape.in.cpp @@ -207,7 +207,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_depth_to_space) { file_util::path_join(CommonTestUtils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/depth_to_space.onnx")); std::vector input(32); - std::iota(input.begin(), input.end(), 0); + std::iota(input.begin(), input.end(), 0.f); std::vector expected_output{0.f, 8.f, 1.f, 9.f, 16.f, 24.f, 17.f, 25.f, 2.f, 10.f, 3.f, 11.f, 18.f, 26.f, 19.f, 27.f, 4.f, 12.f, 5.f, 13.f, 20.f, 28.f, From ea93097286a776bfee93a101dd88efa8a9447332 Mon Sep 17 00:00:00 2001 From: Mateusz Bencer Date: Thu, 16 Mar 2023 19:35:08 +0100 Subject: [PATCH 15/28] fixed next float casts --- src/frontends/onnx/tests/onnx_import.in.cpp | 2 +- .../tests/onnx_import_org_openvino.in.cpp | 268 +++++++++--------- .../onnx/tests/onnx_import_reshape.in.cpp | 2 +- 3 files changed, 138 insertions(+), 134 deletions(-) diff --git a/src/frontends/onnx/tests/onnx_import.in.cpp b/src/frontends/onnx/tests/onnx_import.in.cpp index 78cb2ff488f16e..01771a1c9e8f60 100644 --- a/src/frontends/onnx/tests/onnx_import.in.cpp +++ b/src/frontends/onnx/tests/onnx_import.in.cpp @@ -4586,7 +4586,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dropout12_not_const_training_mode) { NGRAPH_TEST(${BACKEND_NAME}, onnx_multiple_slices_last_layer) { std::vector data(1 * 30 * 320 * 320); - std::fill(data.begin(), data.end(), 1); + std::fill(data.begin(), data.end(), 1.f); const auto function = onnx_import::import_onnx_model(file_util::path_join(CommonTestUtils::getExecutableDirectory(), SERIALIZED_ZOO, diff --git a/src/frontends/onnx/tests/onnx_import_org_openvino.in.cpp b/src/frontends/onnx/tests/onnx_import_org_openvino.in.cpp index fe85ef213db8ae..8177e71c2e46d4 100644 --- a/src/frontends/onnx/tests/onnx_import_org_openvino.in.cpp +++ b/src/frontends/onnx/tests/onnx_import_org_openvino.in.cpp @@ -57,14 +57,14 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_prior_box) { std::vector A(3 * 2 * 2); std::vector B(3 * 6 * 6); std::vector output = { - -2.3200002, -2.3200002, 3.6533334, 3.6533334, -3.7053659, -3.7053659, 5.0386992, 5.0386992, - -0.98666668, -2.3200002, 4.9866667, 3.6533334, -2.3720326, -3.7053659, 6.3720322, 5.0386992, - -2.3200002, -0.98666668, 3.6533334, 4.9866667, -3.7053659, -2.3720326, 5.0386992, 6.3720322, - -0.98666668, -0.98666668, 4.9866667, 4.9866667, -2.3720326, -2.3720326, 6.3720322, 6.3720322, - 0.1, 0.1, 0.2, 0.2, 0.1, 0.1, 0.2, 0.2, - 0.1, 0.1, 0.2, 0.2, 0.1, 0.1, 0.2, 0.2, - 0.1, 0.1, 0.2, 0.2, 0.1, 0.1, 0.2, 0.2, - 0.1, 0.1, 0.2, 0.2, 0.1, 0.1, 0.2, 0.2, + -2.3200002f, -2.3200002f, 3.6533334f, 3.6533334f, -3.7053659f, -3.7053659f, 5.0386992f, 5.0386992f, + -0.98666668f, -2.3200002f, 4.9866667f, 3.6533334f, -2.3720326f, -3.7053659f, 6.3720322f, 5.0386992f, + -2.3200002f, -0.98666668f, 3.6533334f, 4.9866667f, -3.7053659f, -2.3720326f, 5.0386992f, 6.3720322f, + -0.98666668f, -0.98666668f, 4.9866667f, 4.9866667f, -2.3720326f, -2.3720326f, 6.3720322f, 6.3720322f, + 0.1f, 0.1f, 0.2f, 0.2f, 0.1f, 0.1f, 0.2f, 0.2f, + 0.1f, 0.1f, 0.2f, 0.2f, 0.1f, 0.1f, 0.2f, 0.2f, + 0.1f, 0.1f, 0.2f, 0.2f, 0.1f, 0.1f, 0.2f, 0.2f, + 0.1f, 0.1f, 0.2f, 0.2f, 0.1f, 0.1f, 0.2f, 0.2f, }; test_case.add_input(A); test_case.add_input(B); @@ -78,11 +78,11 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_priorbox_clustered) { "onnx/priorbox_clustered.onnx")); auto test_case = test::TestCase(function, s_device); - std::vector A{15.0}; - std::vector B{10.0}; + std::vector A{15.0f}; + std::vector B{10.0f}; std::vector output = { - 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, - 0.1, 0.1, 0.2, 0.2, 0.1, 0.1, 0.2, 0.2, 0.1, 0.1, 0.2, 0.2, 0.1, 0.1, 0.2, 0.2, + 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, + 0.1f, 0.1f, 0.2f, 0.2f, 0.1f, 0.1f, 0.2f, 0.2f, 0.1f, 0.1f, 0.2f, 0.2f, 0.1f, 0.1f, 0.2f, 0.2f, }; test_case.add_input(A); test_case.add_input(B); @@ -101,22 +101,22 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_priorbox_clustered_most_attrs_default) { std::iota(std::begin(A), std::end(A), 0.0f); std::vector B(1 * 1 * 3 * 3); std::iota(std::begin(B), std::end(B), 0.0f); - std::vector output = {-0.1666666716337203979, - -0.1666666716337203979, - 0.1666666716337203979, - 0.1666666716337203979, - -0.1666666716337203979, - 0.3333333432674407959, - 0.1666666716337203979, - 0.6666666865348815918, - 0.1, - 0.1, - 0.2, - 0.2, - 0.1, - 0.1, - 0.2, - 0.2}; + std::vector output = {-0.1666666716337203979f, + -0.1666666716337203979f, + 0.1666666716337203979f, + 0.1666666716337203979f, + -0.1666666716337203979f, + 0.3333333432674407959f, + 0.1666666716337203979f, + 0.6666666865348815918f, + 0.1f, + 0.1f, + 0.2f, + 0.2f, + 0.1f, + 0.1f, + 0.2f, + 0.2f}; test_case.add_input(A); test_case.add_input(B); test_case.add_expected_output(Shape{1, 2, 8}, output); @@ -170,11 +170,11 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_detection_output) { std::vector logits = gen_vector(12, -2, 2); std::vector class_preds = gen_vector(9, 0, 1); std::vector proposals = gen_vector(12 * 2, 0, 1); - std::vector output = {0, 1, 0.777778, 0.279849, 0.283779, 0.562743, 0.695387, - 0, 1, 0.444444, 0.12963, 0.176075, 0.212963, 0.284573, - 0, 2, 0.888889, 0.279849, 0.283779, 0.562743, 0.695387, - 0, 2, 0.555556, 0.12963, 0.176075, 0.212963, 0.284573, - 0, 2, 0.222222, -0.0608094, -0.0142007, -0.0225239, 0.0304044}; + std::vector output = {0, 1, 0.777778f, 0.279849f, 0.283779f, 0.562743f, 0.695387f, + 0, 1, 0.444444f, 0.12963f, 0.176075f, 0.212963f, 0.284573f, + 0, 2, 0.888889f, 0.279849f, 0.283779f, 0.562743f, 0.695387f, + 0, 2, 0.555556f, 0.12963f, 0.176075f, 0.212963f, 0.284573f, + 0, 2, 0.222222f, -0.0608094f, -0.0142007f, -0.0225239f, 0.0304044f}; test_case.add_input(logits); test_case.add_input(class_preds); test_case.add_input(proposals); @@ -192,14 +192,14 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_group_norm) { std::vector data(size); std::iota(data.begin(), data.end(), 0); std::vector output = { - -0.52752507, -0.09108937, 0.3453464, 0.78178215, 2.4364357, 3.309307, 4.1821785, 5.05505, - -1.5825753, -0.27326822, 1.0360391, 2.3453465, 4.8728714, 6.618614, 8.364357, 10.1101, - -2.6376252, -0.45544672, 1.726732, 3.9089108, 7.309307, 9.927921, 12.546536, 15.165151, - -3.6926756, -0.6376257, 2.4174247, 5.472475, 9.745743, 13.237228, 16.728714, 20.2202, - -0.52752507, -0.09108937, 0.3453464, 0.78178215, 2.4364357, 3.309307, 4.1821785, 5.05505, - -1.5825753, -0.27326822, 1.0360391, 2.3453465, 4.8728714, 6.618614, 8.364357, 10.1101, - -2.6376252, -0.45544672, 1.726732, 3.9089108, 7.309307, 9.927921, 12.546536, 15.165151, - -3.6926756, -0.6376257, 2.4174247, 5.472475, 9.745743, 13.237228, 16.728714, 20.2202, + -0.52752507f, -0.09108937f, 0.3453464f, 0.78178215f, 2.4364357f, 3.309307f, 4.1821785f, 5.05505f, + -1.5825753f, -0.27326822f, 1.0360391f, 2.3453465f, 4.8728714f, 6.618614f, 8.364357f, 10.1101f, + -2.6376252f, -0.45544672f, 1.726732f, 3.9089108f, 7.309307f, 9.927921f, 12.546536f, 15.165151f, + -3.6926756f, -0.6376257f, 2.4174247f, 5.472475f, 9.745743f, 13.237228f, 16.728714f, 20.2202f, + -0.52752507f, -0.09108937f, 0.3453464f, 0.78178215f, 2.4364357f, 3.309307f, 4.1821785f, 5.05505f, + -1.5825753f, -0.27326822f, 1.0360391f, 2.3453465f, 4.8728714f, 6.618614f, 8.364357f, 10.1101f, + -2.6376252f, -0.45544672f, 1.726732f, 3.9089108f, 7.309307f, 9.927921f, 12.546536f, 15.165151f, + -3.6926756f, -0.6376257f, 2.4174247f, 5.472475f, 9.745743f, 13.237228f, 16.728714f, 20.2202f, }; test_case.add_input(data); @@ -215,12 +215,13 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_group_norm_5d) { int size = shape_size(shape); std::vector data(size); std::iota(data.begin(), data.end(), 0); - std::vector output = { - -0.34163546562, 0.55278813838, 2.89442372322, 4.68327093124, -1.02490639686, 1.65836453437, 5.78884744644, - 9.36654186248, -1.70817732810, 2.76394081115, 8.68327140808, 14.04981231689, -2.39144825935, 3.86951708793, - 11.57769489288, 18.73308372497, -0.34163546562, 0.55278813838, 2.89442372322, 4.68327093124, -1.02490639686, - 1.65836453437, 5.78884744644, 9.36654186248, -1.70817732810, 2.76394081115, 8.68327140808, 14.04981231689, - -2.39144825935, 3.86951708793, 11.57769489288, 18.73308372497}; + std::vector output = {-0.34163546562f, 0.55278813838f, 2.89442372322f, 4.68327093124f, -1.02490639686f, + 1.65836453437f, 5.78884744644f, 9.36654186248f, -1.70817732810f, 2.76394081115f, + 8.68327140808f, 14.04981231689f, -2.39144825935f, 3.86951708793f, 11.57769489288f, + 18.73308372497f, -0.34163546562f, 0.55278813838f, 2.89442372322f, 4.68327093124f, + -1.02490639686f, 1.65836453437f, 5.78884744644f, 9.36654186248f, -1.70817732810f, + 2.76394081115f, 8.68327140808f, 14.04981231689f, -2.39144825935f, 3.86951708793f, + 11.57769489288f, 18.73308372497f}; test_case.add_input(data); test_case.add_expected_output(shape, output); @@ -234,18 +235,18 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_normalize) { std::vector data(12); std::iota(data.begin(), data.end(), 1); std::vector output = { - 0.19334731, - 0.33806169, - 0.44846106, - 0.53452247, - 1.4501048, - 1.5212777, - 1.5696137, - 1.6035674, - 3.4802516, - 3.3806169, - 3.2887144, - 3.2071347, + 0.19334731f, + 0.33806169f, + 0.44846106f, + 0.53452247f, + 1.4501048f, + 1.5212777f, + 1.5696137f, + 1.6035674f, + 3.4802516f, + 3.3806169f, + 3.2887144f, + 3.2071347f, }; test_case.add_input(data); test_case.add_expected_output(Shape{1, 3, 2, 2}, output); @@ -260,7 +261,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_swish_with_beta) { auto test_case = test::TestCase(function, s_device); std::vector input_data{-0.5f, 0, 0.5f}; test_case.add_input(input_data); - test_case.add_expected_output(expected_output_shape, {-0.2036667, 0.0, 0.2963333}); + test_case.add_expected_output(expected_output_shape, {-0.2036667f, 0.0f, 0.2963333f}); test_case.run_with_tolerance_as_fp(2.0e-5f); } @@ -274,7 +275,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_swish_without_beta) { auto test_case = test::TestCase(function, s_device); std::vector input_data{-0.5f, 0, 0.5f}; test_case.add_input(input_data); - test_case.add_expected_output(expected_output_shape, {-0.18877034, 0.0, 0.31122968}); + test_case.add_expected_output(expected_output_shape, {-0.18877034f, 0.0f, 0.31122968f}); test_case.run_with_tolerance_as_fp(2.0e-5f); } @@ -313,9 +314,9 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_experimental_detectron_detection_output) test_case.add_expected_output(Shape{5, 4}, { 0.8929862f, - 0.892986297607421875, - 12.10701370239257812, - 12.10701370239257812, + 0.892986297607421875f, + 12.10701370239257812f, + 12.10701370239257812f, 0, 0.0f, 0.0f, @@ -444,14 +445,14 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_experimental_detectron_group_norm) { std::vector data(size); std::iota(data.begin(), data.end(), 0); std::vector output = { - -0.52752507, -0.09108937, 0.3453464, 0.78178215, 2.4364357, 3.309307, 4.1821785, 5.05505, - -1.5825753, -0.27326822, 1.0360391, 2.3453465, 4.8728714, 6.618614, 8.364357, 10.1101, - -2.6376252, -0.45544672, 1.726732, 3.9089108, 7.309307, 9.927921, 12.546536, 15.165151, - -3.6926756, -0.6376257, 2.4174247, 5.472475, 9.745743, 13.237228, 16.728714, 20.2202, - -0.52752507, -0.09108937, 0.3453464, 0.78178215, 2.4364357, 3.309307, 4.1821785, 5.05505, - -1.5825753, -0.27326822, 1.0360391, 2.3453465, 4.8728714, 6.618614, 8.364357, 10.1101, - -2.6376252, -0.45544672, 1.726732, 3.9089108, 7.309307, 9.927921, 12.546536, 15.165151, - -3.6926756, -0.6376257, 2.4174247, 5.472475, 9.745743, 13.237228, 16.728714, 20.2202, + -0.52752507f, -0.09108937f, 0.3453464f, 0.78178215f, 2.4364357f, 3.309307f, 4.1821785f, 5.05505f, + -1.5825753f, -0.27326822f, 1.0360391f, 2.3453465f, 4.8728714f, 6.618614f, 8.364357f, 10.1101f, + -2.6376252f, -0.45544672f, 1.726732f, 3.9089108f, 7.309307f, 9.927921f, 12.546536f, 15.165151f, + -3.6926756f, -0.6376257f, 2.4174247f, 5.472475f, 9.745743f, 13.237228f, 16.728714f, 20.2202f, + -0.52752507f, -0.09108937f, 0.3453464f, 0.78178215f, 2.4364357f, 3.309307f, 4.1821785f, 5.05505f, + -1.5825753f, -0.27326822f, 1.0360391f, 2.3453465f, 4.8728714f, 6.618614f, 8.364357f, 10.1101f, + -2.6376252f, -0.45544672f, 1.726732f, 3.9089108f, 7.309307f, 9.927921f, 12.546536f, 15.165151f, + -3.6926756f, -0.6376257f, 2.4174247f, 5.472475f, 9.745743f, 13.237228f, 16.728714f, 20.2202f, }; test_case.add_input(data); @@ -504,42 +505,42 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_experimental_detectron_roi_feature_extra test_case.add_input(pyramid_layer_0); test_case.add_expected_output(Shape{2, 2, 3, 3}, - {1.416666746139526367, - 1.750000119209289551, - 2.083333492279052734, - 2.416666746139526367, - 2.75, - 3.083333492279052734, - 3.166666507720947266, - 3.5, - 3.833333492279052734, - 7.416666507720947266, - 7.75, - 8.083333015441894531, - 8.416666984558105469, - 8.75, - 9.083333969116210938, - 9.166666030883789062, - 9.5, - 9.833333969116210938, - 4.166666984558105469, - 4.5, - 4.833333492279052734, - 4.166666984558105469, - 4.5, - 4.833333492279052734, - 2.083333492279052734, - 2.25, - 2.416666746139526367, - 10.16666603088378906, - 10.5, - 10.83333206176757812, - 10.16666603088378906, - 10.5, - 10.83333206176757812, - 5.083333015441894531, - 5.25, - 5.416666507720947266}); + {1.416666746139526367f, + 1.750000119209289551f, + 2.083333492279052734f, + 2.416666746139526367f, + 2.75f, + 3.083333492279052734f, + 3.166666507720947266f, + 3.5f, + 3.833333492279052734f, + 7.416666507720947266f, + 7.75f, + 8.083333015441894531f, + 8.416666984558105469f, + 8.75f, + 9.083333969116210938f, + 9.166666030883789062f, + 9.5f, + 9.833333969116210938f, + 4.166666984558105469f, + 4.5f, + 4.833333492279052734f, + 4.166666984558105469f, + 4.5f, + 4.833333492279052734f, + 2.083333492279052734f, + 2.25f, + 2.416666746139526367f, + 10.16666603088378906f, + 10.5f, + 10.83333206176757812f, + 10.16666603088378906f, + 10.5f, + 10.83333206176757812f, + 5.083333015441894531f, + 5.25f, + 5.416666507720947266f}); test_case.add_expected_output(Shape{2, 4}, {0, 1, 2, 3, 4, 5, 6, 7}); test_case.run(); @@ -593,29 +594,32 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_generate_proposals) { // scores test_case.add_input( Shape{1, 3, 2, 6}, - {0.56637216, 0.90457034, 0.69827306, 0.4353543, 0.47985056, 0.42658508, 0.14516132, 0.08081771, 0.1799732, - 0.9229515, 0.42420176, 0.50857586, 0.82664067, 0.4972319, 0.3752427, 0.56731623, 0.18241242, 0.33252355, - 0.30608943, 0.6572437, 0.69185436, 0.88646156, 0.36985755, 0.5590753, 0.5256446, 0.03342898, 0.1344396, - 0.68642473, 0.37953874, 0.32575172, 0.21108444, 0.5661886, 0.45378175, 0.62126315, 0.26799858, 0.37272978}); + {0.56637216f, 0.90457034f, 0.69827306f, 0.4353543f, 0.47985056f, 0.42658508f, 0.14516132f, 0.08081771f, + 0.1799732f, 0.9229515f, 0.42420176f, 0.50857586f, 0.82664067f, 0.4972319f, 0.3752427f, 0.56731623f, + 0.18241242f, 0.33252355f, 0.30608943f, 0.6572437f, 0.69185436f, 0.88646156f, 0.36985755f, 0.5590753f, + 0.5256446f, 0.03342898f, 0.1344396f, 0.68642473f, 0.37953874f, 0.32575172f, 0.21108444f, 0.5661886f, + 0.45378175f, 0.62126315f, 0.26799858f, 0.37272978f}); // deltas test_case.add_input( Shape{1, 12, 2, 6}, - {0.5337073, 0.86607957, 0.55151343, 0.21626699, 0.4462629, 0.03985678, 0.5157072, 0.9932138, 0.7565954, - 0.43803605, 0.802818, 0.14834064, 0.53932905, 0.14314, 0.3817048, 0.95075196, 0.05516243, 0.2567484, - 0.25508744, 0.77438325, 0.43561, 0.2094628, 0.8299043, 0.44982538, 0.95615596, 0.5651084, 0.11801951, - 0.05352486, 0.9774733, 0.14439464, 0.62644225, 0.14370479, 0.54161614, 0.557915, 0.53102225, 0.0840179, - 0.7249888, 0.9843559, 0.5490522, 0.53788143, 0.822474, 0.3278008, 0.39688024, 0.3286012, 0.5117038, - 0.04743988, 0.9408995, 0.29885054, 0.81039643, 0.85277915, 0.06807619, 0.86430097, 0.36225632, 0.16606331, - 0.5401001, 0.7541649, 0.11998601, 0.5131829, 0.40606487, 0.327888, 0.27721855, 0.6378373, 0.22795396, - 0.4961256, 0.3215895, 0.15607187, 0.14782153, 0.8908137, 0.8835288, 0.834191, 0.29907143, 0.7983525, - 0.755875, 0.30837986, 0.0839176, 0.26624718, 0.04371626, 0.09472824, 0.20689541, 0.37622106, 0.1083321, - 0.1342548, 0.05815459, 0.7676379, 0.8105144, 0.92348766, 0.26761323, 0.7183306, 0.8947588, 0.19020908, - 0.42731014, 0.7473663, 0.85775334, 0.9340091, 0.3278848, 0.755993, 0.05307213, 0.39705503, 0.21003333, - 0.5625373, 0.66188884, 0.80521655, 0.6125863, 0.44678232, 0.97802377, 0.0204936, 0.02686367, 0.7390654, - 0.74631, 0.58399844, 0.5988792, 0.37413648, 0.5946692, 0.6955776, 0.36377597, 0.7891322, 0.40900692, - 0.99139464, 0.50169915, 0.41435778, 0.17142445, 0.26761186, 0.31591868, 0.14249913, 0.12919712, 0.5418711, - 0.6523203, 0.50259084, 0.7379765, 0.01171071, 0.94423133, 0.00841132, 0.97486794, 0.2921785, 0.7633071, - 0.88477814, 0.03563205, 0.50833166, 0.01354555, 0.535081, 0.41366324, 0.0694767, 0.9944055, 0.9981207}); + {0.5337073f, 0.86607957f, 0.55151343f, 0.21626699f, 0.4462629f, 0.03985678f, 0.5157072f, 0.9932138f, + 0.7565954f, 0.43803605f, 0.802818f, 0.14834064f, 0.53932905f, 0.14314f, 0.3817048f, 0.95075196f, + 0.05516243f, 0.2567484f, 0.25508744f, 0.77438325f, 0.43561f, 0.2094628f, 0.8299043f, 0.44982538f, + 0.95615596f, 0.5651084f, 0.11801951f, 0.05352486f, 0.9774733f, 0.14439464f, 0.62644225f, 0.14370479f, + 0.54161614f, 0.557915f, 0.53102225f, 0.0840179f, 0.7249888f, 0.9843559f, 0.5490522f, 0.53788143f, + 0.822474f, 0.3278008f, 0.39688024f, 0.3286012f, 0.5117038f, 0.04743988f, 0.9408995f, 0.29885054f, + 0.81039643f, 0.85277915f, 0.06807619f, 0.86430097f, 0.36225632f, 0.16606331f, 0.5401001f, 0.7541649f, + 0.11998601f, 0.5131829f, 0.40606487f, 0.327888f, 0.27721855f, 0.6378373f, 0.22795396f, 0.4961256f, + 0.3215895f, 0.15607187f, 0.14782153f, 0.8908137f, 0.8835288f, 0.834191f, 0.29907143f, 0.7983525f, + 0.755875f, 0.30837986f, 0.0839176f, 0.26624718f, 0.04371626f, 0.09472824f, 0.20689541f, 0.37622106f, + 0.1083321f, 0.1342548f, 0.05815459f, 0.7676379f, 0.8105144f, 0.92348766f, 0.26761323f, 0.7183306f, + 0.8947588f, 0.19020908f, 0.42731014f, 0.7473663f, 0.85775334f, 0.9340091f, 0.3278848f, 0.755993f, + 0.05307213f, 0.39705503f, 0.21003333f, 0.5625373f, 0.66188884f, 0.80521655f, 0.6125863f, 0.44678232f, + 0.97802377f, 0.0204936f, 0.02686367f, 0.7390654f, 0.74631f, 0.58399844f, 0.5988792f, 0.37413648f, + 0.5946692f, 0.6955776f, 0.36377597f, 0.7891322f, 0.40900692f, 0.99139464f, 0.50169915f, 0.41435778f, + 0.17142445f, 0.26761186f, 0.31591868f, 0.14249913f, 0.12919712f, 0.5418711f, 0.6523203f, 0.50259084f, + 0.7379765f, 0.01171071f, 0.94423133f, 0.00841132f, 0.97486794f, 0.2921785f, 0.7633071f, 0.88477814f, + 0.03563205f, 0.50833166f, 0.01354555f, 0.535081f, 0.41366324f, 0.0694767f, 0.9944055f, 0.9981207f}); // im_info test_case.add_input(Shape{1, 3}, {200, 200, 0}); // anchors @@ -623,11 +627,11 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_generate_proposals) { test_case.add_expected_output( Shape{6, 4}, - {0.12904608, 1.3703424, 3.6230984, 3.4675088, 0.9725206, 0., 4.4917974, 4.9623675, - 4.882682, 5.1236916, 7.1700497, 10.213073, 4.4913187, 4.305372, 8.750267, 8.803502, - 0.9777608, 1.0317986, 3.228293, 4.495021, 4.125554, 5.4091997, 6.35439, 10.124915}); + {0.12904608f, 1.3703424f, 3.6230984f, 3.4675088f, 0.9725206f, 0., 4.4917974f, 4.9623675f, + 4.882682f, 5.1236916f, 7.1700497f, 10.213073f, 4.4913187f, 4.305372f, 8.750267f, 8.803502f, + 0.9777608f, 1.0317986f, 3.228293f, 4.495021f, 4.125554f, 5.4091997f, 6.35439f, 10.124915f}); test_case.add_expected_output(Shape{6}, - {0.9229515, 0.90457034, 0.88646156, 0.82664067, 0.69827306, 0.69185436}); + {0.9229515f, 0.90457034f, 0.88646156f, 0.82664067f, 0.69827306f, 0.69185436f}); test_case.add_expected_output(Shape{1}, {6}); test_case.run(); } diff --git a/src/frontends/onnx/tests/onnx_import_reshape.in.cpp b/src/frontends/onnx/tests/onnx_import_reshape.in.cpp index 33f71a945b9d78..3e25a3ea1c90a0 100644 --- a/src/frontends/onnx/tests/onnx_import_reshape.in.cpp +++ b/src/frontends/onnx/tests/onnx_import_reshape.in.cpp @@ -224,7 +224,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_depth_to_space_v1) { file_util::path_join(CommonTestUtils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/depth_to_space_v1.onnx")); std::vector input(32); - std::iota(input.begin(), input.end(), 0); + std::iota(input.begin(), input.end(), 0.f); std::vector expected_output{0.f, 8.f, 1.f, 9.f, 16.f, 24.f, 17.f, 25.f, 2.f, 10.f, 3.f, 11.f, 18.f, 26.f, 19.f, 27.f, 4.f, 12.f, 5.f, 13.f, 20.f, 28.f, From 99cde74b07dd872c56cc03dbc6d92c1b480bb353 Mon Sep 17 00:00:00 2001 From: Mateusz Bencer Date: Mon, 20 Mar 2023 09:45:19 +0100 Subject: [PATCH 16/28] fix float cast --- src/frontends/onnx/tests/onnx_import.in.cpp | 42 +++++++++---------- .../tests/onnx_import_org_openvino.in.cpp | 2 +- .../onnx/tests/onnx_import_reshape.in.cpp | 2 +- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/frontends/onnx/tests/onnx_import.in.cpp b/src/frontends/onnx/tests/onnx_import.in.cpp index 01771a1c9e8f60..1b9ad97d46cff4 100644 --- a/src/frontends/onnx/tests/onnx_import.in.cpp +++ b/src/frontends/onnx/tests/onnx_import.in.cpp @@ -469,7 +469,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_expand_function_greater_or_equal_inside_if) { // expected value == x * y std::vector x(40, 2); std::vector y(40); - std::iota(y.begin(), y.end(), -20); + std::iota(y.begin(), y.end(), -20.f); std::vector expected; std::transform(x.begin(), x.end(), y.begin(), std::back_inserter(expected), [](float i, float j) -> float { return i * j; @@ -1849,15 +1849,15 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_resize11_up_sizes_cubic_half_pixel) { test_case.add_expected_output( expected_output_shape, {0.45507922f, 0.64057922f, 0.97157922f, 1.42257922f, 1.90732922f, 2.22332922f, 2.70807922f, 3.15907922f, - 3.49007922f, 3.67557922, 1.39437963f, 1.57987963f, 1.91087963f, 2.36187963f, 2.84662963, 3.16262963f, - 3.64737963f, 4.09837963f, 4.42937963f, 4.61487963, 2.95130693f, 3.13680693f, 3.46780693f, 3.91880693f, - 4.40355693, 4.71955693f, 5.20430693f, 5.65530693f, 5.98630693f, 6.17180693, 5.20525069f, 5.39075069f, - 5.72175069f, 6.17275069f, 6.65750069, 6.97350069f, 7.45825069f, 7.90925069f, 8.24025069f, 8.42575069, + 3.49007922f, 3.67557922f, 1.39437963f, 1.57987963f, 1.91087963f, 2.36187963f, 2.84662963f, 3.16262963f, + 3.64737963f, 4.09837963f, 4.42937963f, 4.61487963f, 2.95130693f, 3.13680693f, 3.46780693f, 3.91880693f, + 4.40355693f, 4.71955693f, 5.20430693f, 5.65530693f, 5.98630693f, 6.17180693f, 5.20525069f, 5.39075069f, + 5.72175069f, 6.17275069f, 6.65750069f, 6.97350069f, 7.45825069f, 7.90925069f, 8.24025069f, 8.42575069f, 6.88975f, 7.07525f, 7.40625f, 7.85725f, 8.342f, 8.658f, 9.14275f, 9.59375f, - 9.92475f, 10.11025f, 8.57424931f, 8.75974931f, 9.09074931f, 9.54174931f, 10.02649931, 10.34249931f, - 10.82724931f, 11.27824931f, 11.60924931f, 11.79474931, 10.82819307f, 11.01369307f, 11.34469307f, 11.79569307f, - 12.28044307, 12.59644307f, 13.08119307f, 13.53219307f, 13.86319307f, 14.04869307, 12.38512037f, 12.57062037f, - 12.90162037f, 13.35262037f, 13.83737037, 14.15337037f, 14.63812037f, 15.08912037f, 15.42012037f, 15.60562037, + 9.92475f, 10.11025f, 8.57424931f, 8.75974931f, 9.09074931f, 9.54174931f, 10.02649931f, 10.34249931f, + 10.82724931f, 11.27824931f, 11.60924931f, 11.79474931f, 10.82819307f, 11.01369307f, 11.34469307f, 11.79569307f, + 12.28044307f, 12.59644307f, 13.08119307f, 13.53219307f, 13.86319307f, 14.04869307f, 12.38512037f, 12.57062037f, + 12.90162037f, 13.35262037f, 13.83737037f, 14.15337037f, 14.63812037f, 15.08912037f, 15.42012037f, 15.60562037, 13.32442078f, 13.50992078f, 13.84092078f, 14.29192078f, 14.77667078f, 15.09267078f, 15.57742078f, 16.02842078f, 16.35942078f, 16.54492078f}); test_case.run_with_tolerance_as_fp(2.0e-5f); @@ -1892,14 +1892,14 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_resize11_up_sizes_cubic_half_pixel_dynamic_siz test_case.add_expected_output( expected_output_shape, {0.45507922f, 0.64057922f, 0.97157922f, 1.42257922f, 1.90732922f, 2.22332922f, 2.70807922f, 3.15907922f, - 3.49007922f, 3.67557922, 1.39437963f, 1.57987963f, 1.91087963f, 2.36187963f, 2.84662963f, 3.16262963f, - 3.64737963f, 4.09837963f, 4.42937963f, 4.61487963, 2.95130693f, 3.13680693f, 3.46780693f, 3.91880693f, - 4.40355693, 4.71955693f, 5.20430693f, 5.65530693f, 5.98630693f, 6.17180693, 5.20525069f, 5.39075069f, + 3.49007922f, 3.67557922f, 1.39437963f, 1.57987963f, 1.91087963f, 2.36187963f, 2.84662963f, 3.16262963f, + 3.64737963f, 4.09837963f, 4.42937963f, 4.61487963f, 2.95130693f, 3.13680693f, 3.46780693f, 3.91880693f, + 4.40355693f, 4.71955693f, 5.20430693f, 5.65530693f, 5.98630693f, 6.17180693f, 5.20525069f, 5.39075069f, 5.72175069f, 6.17275069f, 6.65750069f, 6.97350069f, 7.45825069f, 7.90925069f, 8.24025069f, 8.42575069f, 6.88975f, 7.07525f, 7.40625f, 7.85725f, 8.342f, 8.658f, 9.14275f, 9.59375f, 9.92475f, 10.11025f, 8.57424931f, 8.75974931f, 9.09074931f, 9.54174931f, 10.02649931f, 10.34249931f, - 10.82724931f, 11.27824931f, 11.60924931f, 11.79474931, 10.82819307f, 11.01369307f, 11.34469307f, 11.79569307f, - 12.28044307, 12.59644307f, 13.08119307f, 13.53219307f, 13.86319307f, 14.04869307f, 12.38512037f, 12.57062037f, + 10.82724931f, 11.27824931f, 11.60924931f, 11.79474931f, 10.82819307f, 11.01369307f, 11.34469307f, 11.79569307f, + 12.28044307f, 12.59644307f, 13.08119307f, 13.53219307f, 13.86319307f, 14.04869307f, 12.38512037f, 12.57062037f, 12.90162037f, 13.35262037f, 13.83737037f, 14.15337037f, 14.63812037f, 15.08912037f, 15.42012037f, 15.60562037f, 13.32442078f, 13.50992078f, 13.84092078f, 14.29192078f, 14.77667078f, 15.09267078f, 15.57742078f, 16.02842078f, 16.35942078f, 16.54492078f}); @@ -4593,10 +4593,10 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_multiple_slices_last_layer) { "onnx/multiple_slices_last_layer.onnx")); auto test_case = test::TestCase(function, s_device); std::vector o1(1 * 320 * 320 * 21); - std::fill(o1.begin(), o1.end(), 1); + std::fill(o1.begin(), o1.end(), 1.f); std::vector o2(1 * 320 * 320 * 9); - std::fill(o2.begin(), o2.end(), 1); + std::fill(o2.begin(), o2.end(), 1.f); test_case.add_input(data); test_case.add_expected_output(Shape{1, 320, 320, 21}, o1); @@ -5453,7 +5453,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_scan15f_ND_mixed_vals) { test_case.add_input(Shape{1, 3, 2}, {0.f, 0.f, 0.f, 0.f, 0.f, 0.f}); test_case.add_input(Shape{1, 3, 2}, {1.f, 1.f, 1.f, 1.f, 1.f, 1.f}); std::vector sequence_vals{0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.f, - 1.1f, 1.2f, 1.3f, 1.4f, 1.5f, 1.6f, 1.7, 1.8f, 1.9f, 2.f, + 1.1f, 1.2f, 1.3f, 1.4f, 1.5f, 1.6f, 1.7f, 1.8f, 1.9f, 2.f, 2.1f, 2.2f, 2.3f, 2.4f, 2.5f, 2.6f, 2.7f, 2.8f, 2.9f, 3.f}; test_case.add_input(Shape{1, 3, 5, 2}, sequence_vals); // multiply factor (reverse) test_case.add_input(Shape{1, 5, 3, 2}, sequence_vals); // div factor @@ -5545,8 +5545,8 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_scan15_ND_b4_input_rev_vals) { "onnx/scan15_ND_b4_input_rev.onnx")); auto test_case = test::TestCase(function, s_device); - test_case.add_input(Shape{4, 3, 2}, std::vector(24.f, 0.f)); - test_case.add_input(Shape{4, 3, 2}, std::vector(24.f, 1.f)); + test_case.add_input(Shape{4, 3, 2}, {4.f, 0.f}); + test_case.add_input(Shape{4, 3, 2}, {24.f, 1.f}); std::vector sequence_vals{ 0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.f, 1.1f, 1.2f, 1.3f, 1.4f, 1.5f, 1.6f, 1.7f, 1.8f, 1.9f, 2.f, 2.1f, 2.2f, 2.3f, 2.4f, 2.5f, 2.6f, 2.7f, 2.8f, 2.9f, 3.f, @@ -5619,8 +5619,8 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_scan8_ND_b4_input_rev_vals) { "onnx/scan8_ND_b4_input_rev.onnx")); auto test_case = test::TestCase(function, s_device); - test_case.add_input(Shape{4, 3, 2}, std::vector(24.f, 0.f)); - test_case.add_input(Shape{4, 3, 2}, std::vector(24.f, 1.f)); + test_case.add_input(Shape{4, 3, 2}, {24.f, 0.f}); + test_case.add_input(Shape{4, 3, 2}, {24.f, 1.f}); std::vector sequence_vals{ 0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.f, 1.1f, 1.2f, 1.3f, 1.4f, 1.5f, 1.6f, 1.7f, 1.8f, 1.9f, 2.f, 2.1f, 2.2f, 2.3f, 2.4f, 2.5f, 2.6f, 2.7f, 2.8f, 2.9f, 3.f, diff --git a/src/frontends/onnx/tests/onnx_import_org_openvino.in.cpp b/src/frontends/onnx/tests/onnx_import_org_openvino.in.cpp index 8177e71c2e46d4..6c29ef6b6c550d 100644 --- a/src/frontends/onnx/tests/onnx_import_org_openvino.in.cpp +++ b/src/frontends/onnx/tests/onnx_import_org_openvino.in.cpp @@ -190,7 +190,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_group_norm) { Shape shape{2, 8, 2, 2}; int size = shape_size(shape); std::vector data(size); - std::iota(data.begin(), data.end(), 0); + std::iota(data.begin(), data.end(), 0.f); std::vector output = { -0.52752507f, -0.09108937f, 0.3453464f, 0.78178215f, 2.4364357f, 3.309307f, 4.1821785f, 5.05505f, -1.5825753f, -0.27326822f, 1.0360391f, 2.3453465f, 4.8728714f, 6.618614f, 8.364357f, 10.1101f, diff --git a/src/frontends/onnx/tests/onnx_import_reshape.in.cpp b/src/frontends/onnx/tests/onnx_import_reshape.in.cpp index 3e25a3ea1c90a0..d7c553eee629bd 100644 --- a/src/frontends/onnx/tests/onnx_import_reshape.in.cpp +++ b/src/frontends/onnx/tests/onnx_import_reshape.in.cpp @@ -242,7 +242,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_depth_to_space_crd) { "onnx/depth_to_space_crd.onnx")); std::vector input(32); - std::iota(input.begin(), input.end(), 0); + std::iota(input.begin(), input.end(), 0.f); std::vector expected_output{0.f, 4.f, 1.f, 5.f, 8.f, 12.f, 9.f, 13.f, 2.f, 6.f, 3.f, 7.f, 10.f, 14.f, 11.f, 15.f, 16.f, 20.f, 17.f, 21.f, 24.f, 28.f, From 7a562ae8201829e05748111f8f46980c998c3cb9 Mon Sep 17 00:00:00 2001 From: Mateusz Bencer Date: Mon, 20 Mar 2023 09:58:09 +0100 Subject: [PATCH 17/28] styles --- src/frontends/onnx/tests/onnx_import.in.cpp | 28 ++++++++++----------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/frontends/onnx/tests/onnx_import.in.cpp b/src/frontends/onnx/tests/onnx_import.in.cpp index 1b9ad97d46cff4..9413cadd23fc41 100644 --- a/src/frontends/onnx/tests/onnx_import.in.cpp +++ b/src/frontends/onnx/tests/onnx_import.in.cpp @@ -1849,15 +1849,15 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_resize11_up_sizes_cubic_half_pixel) { test_case.add_expected_output( expected_output_shape, {0.45507922f, 0.64057922f, 0.97157922f, 1.42257922f, 1.90732922f, 2.22332922f, 2.70807922f, 3.15907922f, - 3.49007922f, 3.67557922f, 1.39437963f, 1.57987963f, 1.91087963f, 2.36187963f, 2.84662963f, 3.16262963f, - 3.64737963f, 4.09837963f, 4.42937963f, 4.61487963f, 2.95130693f, 3.13680693f, 3.46780693f, 3.91880693f, - 4.40355693f, 4.71955693f, 5.20430693f, 5.65530693f, 5.98630693f, 6.17180693f, 5.20525069f, 5.39075069f, - 5.72175069f, 6.17275069f, 6.65750069f, 6.97350069f, 7.45825069f, 7.90925069f, 8.24025069f, 8.42575069f, + 3.49007922f, 3.67557922f, 1.39437963f, 1.57987963f, 1.91087963f, 2.36187963f, 2.84662963f, 3.16262963f, + 3.64737963f, 4.09837963f, 4.42937963f, 4.61487963f, 2.95130693f, 3.13680693f, 3.46780693f, 3.91880693f, + 4.40355693f, 4.71955693f, 5.20430693f, 5.65530693f, 5.98630693f, 6.17180693f, 5.20525069f, 5.39075069f, + 5.72175069f, 6.17275069f, 6.65750069f, 6.97350069f, 7.45825069f, 7.90925069f, 8.24025069f, 8.42575069f, 6.88975f, 7.07525f, 7.40625f, 7.85725f, 8.342f, 8.658f, 9.14275f, 9.59375f, - 9.92475f, 10.11025f, 8.57424931f, 8.75974931f, 9.09074931f, 9.54174931f, 10.02649931f, 10.34249931f, - 10.82724931f, 11.27824931f, 11.60924931f, 11.79474931f, 10.82819307f, 11.01369307f, 11.34469307f, 11.79569307f, - 12.28044307f, 12.59644307f, 13.08119307f, 13.53219307f, 13.86319307f, 14.04869307f, 12.38512037f, 12.57062037f, - 12.90162037f, 13.35262037f, 13.83737037f, 14.15337037f, 14.63812037f, 15.08912037f, 15.42012037f, 15.60562037, + 9.92475f, 10.11025f, 8.57424931f, 8.75974931f, 9.09074931f, 9.54174931f, 10.02649931f, 10.34249931f, + 10.82724931f, 11.27824931f, 11.60924931f, 11.79474931f, 10.82819307f, 11.01369307f, 11.34469307f, 11.79569307f, + 12.28044307f, 12.59644307f, 13.08119307f, 13.53219307f, 13.86319307f, 14.04869307f, 12.38512037f, 12.57062037f, + 12.90162037f, 13.35262037f, 13.83737037f, 14.15337037f, 14.63812037f, 15.08912037f, 15.42012037f, 15.60562037, 13.32442078f, 13.50992078f, 13.84092078f, 14.29192078f, 14.77667078f, 15.09267078f, 15.57742078f, 16.02842078f, 16.35942078f, 16.54492078f}); test_case.run_with_tolerance_as_fp(2.0e-5f); @@ -1892,14 +1892,14 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_resize11_up_sizes_cubic_half_pixel_dynamic_siz test_case.add_expected_output( expected_output_shape, {0.45507922f, 0.64057922f, 0.97157922f, 1.42257922f, 1.90732922f, 2.22332922f, 2.70807922f, 3.15907922f, - 3.49007922f, 3.67557922f, 1.39437963f, 1.57987963f, 1.91087963f, 2.36187963f, 2.84662963f, 3.16262963f, - 3.64737963f, 4.09837963f, 4.42937963f, 4.61487963f, 2.95130693f, 3.13680693f, 3.46780693f, 3.91880693f, - 4.40355693f, 4.71955693f, 5.20430693f, 5.65530693f, 5.98630693f, 6.17180693f, 5.20525069f, 5.39075069f, + 3.49007922f, 3.67557922f, 1.39437963f, 1.57987963f, 1.91087963f, 2.36187963f, 2.84662963f, 3.16262963f, + 3.64737963f, 4.09837963f, 4.42937963f, 4.61487963f, 2.95130693f, 3.13680693f, 3.46780693f, 3.91880693f, + 4.40355693f, 4.71955693f, 5.20430693f, 5.65530693f, 5.98630693f, 6.17180693f, 5.20525069f, 5.39075069f, 5.72175069f, 6.17275069f, 6.65750069f, 6.97350069f, 7.45825069f, 7.90925069f, 8.24025069f, 8.42575069f, 6.88975f, 7.07525f, 7.40625f, 7.85725f, 8.342f, 8.658f, 9.14275f, 9.59375f, 9.92475f, 10.11025f, 8.57424931f, 8.75974931f, 9.09074931f, 9.54174931f, 10.02649931f, 10.34249931f, - 10.82724931f, 11.27824931f, 11.60924931f, 11.79474931f, 10.82819307f, 11.01369307f, 11.34469307f, 11.79569307f, - 12.28044307f, 12.59644307f, 13.08119307f, 13.53219307f, 13.86319307f, 14.04869307f, 12.38512037f, 12.57062037f, + 10.82724931f, 11.27824931f, 11.60924931f, 11.79474931f, 10.82819307f, 11.01369307f, 11.34469307f, 11.79569307f, + 12.28044307f, 12.59644307f, 13.08119307f, 13.53219307f, 13.86319307f, 14.04869307f, 12.38512037f, 12.57062037f, 12.90162037f, 13.35262037f, 13.83737037f, 14.15337037f, 14.63812037f, 15.08912037f, 15.42012037f, 15.60562037f, 13.32442078f, 13.50992078f, 13.84092078f, 14.29192078f, 14.77667078f, 15.09267078f, 15.57742078f, 16.02842078f, 16.35942078f, 16.54492078f}); @@ -5453,7 +5453,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_scan15f_ND_mixed_vals) { test_case.add_input(Shape{1, 3, 2}, {0.f, 0.f, 0.f, 0.f, 0.f, 0.f}); test_case.add_input(Shape{1, 3, 2}, {1.f, 1.f, 1.f, 1.f, 1.f, 1.f}); std::vector sequence_vals{0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.f, - 1.1f, 1.2f, 1.3f, 1.4f, 1.5f, 1.6f, 1.7f, 1.8f, 1.9f, 2.f, + 1.1f, 1.2f, 1.3f, 1.4f, 1.5f, 1.6f, 1.7f, 1.8f, 1.9f, 2.f, 2.1f, 2.2f, 2.3f, 2.4f, 2.5f, 2.6f, 2.7f, 2.8f, 2.9f, 3.f}; test_case.add_input(Shape{1, 3, 5, 2}, sequence_vals); // multiply factor (reverse) test_case.add_input(Shape{1, 5, 3, 2}, sequence_vals); // div factor From 4704275441e511b86dd4f6c5002144b70d21828b Mon Sep 17 00:00:00 2001 From: Mateusz Bencer Date: Mon, 20 Mar 2023 13:11:40 +0100 Subject: [PATCH 18/28] fixed test --- src/frontends/onnx/tests/onnx_import.in.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/frontends/onnx/tests/onnx_import.in.cpp b/src/frontends/onnx/tests/onnx_import.in.cpp index 9413cadd23fc41..fd579d5acf0303 100644 --- a/src/frontends/onnx/tests/onnx_import.in.cpp +++ b/src/frontends/onnx/tests/onnx_import.in.cpp @@ -5545,8 +5545,8 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_scan15_ND_b4_input_rev_vals) { "onnx/scan15_ND_b4_input_rev.onnx")); auto test_case = test::TestCase(function, s_device); - test_case.add_input(Shape{4, 3, 2}, {4.f, 0.f}); - test_case.add_input(Shape{4, 3, 2}, {24.f, 1.f}); + test_case.add_input(Shape{4, 3, 2}, std::vector(24, 0.f)); + test_case.add_input(Shape{4, 3, 2}, std::vector(24, 1.f)); std::vector sequence_vals{ 0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.f, 1.1f, 1.2f, 1.3f, 1.4f, 1.5f, 1.6f, 1.7f, 1.8f, 1.9f, 2.f, 2.1f, 2.2f, 2.3f, 2.4f, 2.5f, 2.6f, 2.7f, 2.8f, 2.9f, 3.f, @@ -5556,7 +5556,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_scan15_ND_b4_input_rev_vals) { 7.6f, 7.7f, 7.8f, 7.9f, 8.f, 8.1f, 8.2f, 8.3f, 8.4f, 8.5f, 8.6f, 8.7f, 8.8f, 8.9f, 9.f, 9.1f, 9.2f, 9.3f, 9.4f, 9.5f, 9.6f, 9.7f, 9.8f, 9.9f, 10.f, 10.1f, 10.2f, 10.3f, 10.4f, 10.5f, 10.6f, 10.7f, 10.8f, 10.9f, 11.f, 11.1f, 11.2f, 11.3f, 11.4f, 11.5f, 11.6f, 11.7f, 11.8f, 11.9f, 12.f}; - test_case.add_input(Shape{4, 5, 3, 2}, sequence_vals); // multiply factor (reverse) + test_case.add_input(Shape{4, 5, 3, 2}, sequence_vals); // multiply factor (areverse) test_case.add_input(Shape{4, 5, 3, 2}, sequence_vals); // div factor test_case.add_expected_output( @@ -5619,8 +5619,8 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_scan8_ND_b4_input_rev_vals) { "onnx/scan8_ND_b4_input_rev.onnx")); auto test_case = test::TestCase(function, s_device); - test_case.add_input(Shape{4, 3, 2}, {24.f, 0.f}); - test_case.add_input(Shape{4, 3, 2}, {24.f, 1.f}); + test_case.add_input(Shape{4, 3, 2}, std::vector(24, 0.f)); + test_case.add_input(Shape{4, 3, 2}, std::vector(24, 1.f)); std::vector sequence_vals{ 0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.f, 1.1f, 1.2f, 1.3f, 1.4f, 1.5f, 1.6f, 1.7f, 1.8f, 1.9f, 2.f, 2.1f, 2.2f, 2.3f, 2.4f, 2.5f, 2.6f, 2.7f, 2.8f, 2.9f, 3.f, From a1b8b2d7047697550f809ff6d70ea8b7a1acbb94 Mon Sep 17 00:00:00 2001 From: Mateusz Bencer Date: Mon, 20 Mar 2023 15:29:14 +0100 Subject: [PATCH 19/28] float cast ... --- src/frontends/onnx/tests/onnx_import.in.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontends/onnx/tests/onnx_import.in.cpp b/src/frontends/onnx/tests/onnx_import.in.cpp index fd579d5acf0303..25f578429fef49 100644 --- a/src/frontends/onnx/tests/onnx_import.in.cpp +++ b/src/frontends/onnx/tests/onnx_import.in.cpp @@ -1857,7 +1857,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_resize11_up_sizes_cubic_half_pixel) { 9.92475f, 10.11025f, 8.57424931f, 8.75974931f, 9.09074931f, 9.54174931f, 10.02649931f, 10.34249931f, 10.82724931f, 11.27824931f, 11.60924931f, 11.79474931f, 10.82819307f, 11.01369307f, 11.34469307f, 11.79569307f, 12.28044307f, 12.59644307f, 13.08119307f, 13.53219307f, 13.86319307f, 14.04869307f, 12.38512037f, 12.57062037f, - 12.90162037f, 13.35262037f, 13.83737037f, 14.15337037f, 14.63812037f, 15.08912037f, 15.42012037f, 15.60562037, + 12.90162037f, 13.35262037f, 13.83737037f, 14.15337037f, 14.63812037f, 15.08912037f, 15.42012037f, 15.60562037f, 13.32442078f, 13.50992078f, 13.84092078f, 14.29192078f, 14.77667078f, 15.09267078f, 15.57742078f, 16.02842078f, 16.35942078f, 16.54492078f}); test_case.run_with_tolerance_as_fp(2.0e-5f); From 0571980b4653b8ac0ee3486cb9f805ec74089121 Mon Sep 17 00:00:00 2001 From: Mateusz Bencer Date: Mon, 20 Mar 2023 22:06:53 +0100 Subject: [PATCH 20/28] fix float cast --- src/frontends/onnx/tests/onnx_import.in.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontends/onnx/tests/onnx_import.in.cpp b/src/frontends/onnx/tests/onnx_import.in.cpp index 25f578429fef49..a92db48792ba68 100644 --- a/src/frontends/onnx/tests/onnx_import.in.cpp +++ b/src/frontends/onnx/tests/onnx_import.in.cpp @@ -2177,7 +2177,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_prelu_batch_nd_elementwise) { // Shape{2, 3, 4, 5} std::vector slope(shape_size(Shape{2, 3, 4, 5})); - std::iota(std::begin(slope), std::end(slope), 0); + std::iota(std::begin(slope), std::end(slope), 0.f); inputs.emplace_back(slope); // Shape{2, 3, 4, 5} From 9c025b4cf513190583fa01522fc6ff3b6570c83b Mon Sep 17 00:00:00 2001 From: Mateusz Bencer Date: Tue, 21 Mar 2023 09:19:18 +0100 Subject: [PATCH 21/28] fix float cast in iota --- src/frontends/onnx/tests/onnx_import.in.cpp | 32 ++++++++-------- .../onnx/tests/onnx_import_controlflow.in.cpp | 14 +++---- .../onnx/tests/onnx_import_dyn_shapes.in.cpp | 38 +++++++++---------- .../tests/onnx_import_org_openvino.in.cpp | 16 ++++---- .../onnx/tests/onnx_import_reshape.in.cpp | 2 +- 5 files changed, 51 insertions(+), 51 deletions(-) diff --git a/src/frontends/onnx/tests/onnx_import.in.cpp b/src/frontends/onnx/tests/onnx_import.in.cpp index a92db48792ba68..871d32d322af49 100644 --- a/src/frontends/onnx/tests/onnx_import.in.cpp +++ b/src/frontends/onnx/tests/onnx_import.in.cpp @@ -2852,7 +2852,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_lp_norm_p1) { Shape data_shape{2, 3, 4}; std::vector data(shape_size(data_shape)); - std::iota(std::begin(data), std::end(data), 1); + std::iota(std::begin(data), std::end(data), 1.f); auto test_case = test::TestCase(function, s_device); test_case.add_input(data); @@ -2871,7 +2871,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_lp_norm_p2) { Shape data_shape{2, 3, 4}; std::vector data(shape_size(data_shape)); - std::iota(std::begin(data), std::end(data), 1); + std::iota(std::begin(data), std::end(data), 1.f); auto test_case = test::TestCase(function, s_device); test_case.add_input(data); @@ -2890,7 +2890,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_lp_norm_default) { Shape data_shape{2, 3, 4}; std::vector data(shape_size(data_shape)); - std::iota(std::begin(data), std::end(data), 1); + std::iota(std::begin(data), std::end(data), 1.f); auto test_case = test::TestCase(function, s_device); test_case.add_input(data); @@ -2910,7 +2910,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_lp_norm_default_dynamic) { Shape data_shape{2, 3, 4}; std::vector data(shape_size(data_shape)); - std::iota(std::begin(data), std::end(data), 1); + std::iota(std::begin(data), std::end(data), 1.f); auto test_case = test::TestCase(function, s_device); test_case.add_input(data_shape, data); @@ -2929,7 +2929,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_instance_normalization) { Shape data_shape{1, 2, 3, 4}; std::vector data(shape_size(data_shape)); - std::iota(std::begin(data), std::end(data), 1); + std::iota(std::begin(data), std::end(data), 1.f); auto test_case = test::TestCase(function, s_device); @@ -4012,7 +4012,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_mul_v6_broadcast_axis_1) { Shape shape{1, 3, 2, 2}; std::vector A(shape_size(shape)); - std::iota(A.begin(), A.end(), 1); + std::iota(A.begin(), A.end(), 1.f); test_case.add_input(A); test_case.add_input({3.0f, 4.0f, 5.0f}); test_case.add_expected_output( @@ -4044,7 +4044,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_mul_v6_broadcast_no_axis) { Shape shape{2, 2}; std::vector A(shape_size(shape)); - std::iota(A.begin(), A.end(), 1); + std::iota(A.begin(), A.end(), 1.f); test_case.add_input(A); test_case.add_input({3.0f}); test_case.add_expected_output(shape, {3.0f, 6.0f, 9.0f, 12.0f}); @@ -4069,7 +4069,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_mul_v7_broadcast) { Shape shape{1, 2, 3}; std::vector A(shape_size(shape)); - std::iota(A.begin(), A.end(), 1); + std::iota(A.begin(), A.end(), 1.f); test_case.add_input(A); test_case.add_input({3.0f, 4.0f, 5.0f}); test_case.add_expected_output(shape, {3.0f, 8.0f, 15.0f, 12.0f, 20.0f, 30.0f}); @@ -4084,7 +4084,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_add_v6_broadcast_axis_1) { Shape shape{1, 3, 2, 2}; std::vector A(shape_size(shape)); - std::iota(A.begin(), A.end(), 1); + std::iota(A.begin(), A.end(), 1.f); test_case.add_input(A); test_case.add_input({3.0f, 4.0f, 5.0f}); test_case.add_expected_output( @@ -4115,7 +4115,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_add_v6_broadcast_no_axis) { Shape shape{2, 2}; std::vector A(shape_size(shape)); - std::iota(A.begin(), A.end(), 1); + std::iota(A.begin(), A.end(), 1.f); test_case.add_input(A); test_case.add_input({3.0f}); test_case.add_expected_output(shape, {4.0f, 5.0f, 6.0f, 7.0f}); @@ -4141,7 +4141,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_sub_v6_broadcast_axis_1) { Shape shape{1, 3, 2, 2}; std::vector A(shape_size(shape)); - std::iota(A.begin(), A.end(), 1); + std::iota(A.begin(), A.end(), 1.f); test_case.add_input(A); test_case.add_input({3.0f, 4.0f, 5.0f}); test_case.add_expected_output(shape, @@ -4172,7 +4172,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_sub_v6_broadcast_no_axis) { Shape shape{2, 2}; std::vector A(shape_size(shape)); - std::iota(A.begin(), A.end(), 1); + std::iota(A.begin(), A.end(), 1.f); test_case.add_input(A); test_case.add_input({3.0f}); test_case.add_expected_output(shape, {-2.0f, -1.0f, 0.0f, 1.0f}); @@ -4197,7 +4197,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_sub_v7_broadcast) { Shape shape{1, 2, 3}; std::vector A(shape_size(shape)); - std::iota(A.begin(), A.end(), 1); + std::iota(A.begin(), A.end(), 1.f); test_case.add_input(A); test_case.add_input({3.0f, 4.0f, 5.0f}); test_case.add_expected_output(shape, {-2.0f, -2.0f, -2.0f, 1.0f, 1.0f, 1.0f}); @@ -4212,7 +4212,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_div_v6_broadcast_axis_1) { Shape shape{1, 3, 2, 2}; std::vector A(shape_size(shape)); - std::iota(A.begin(), A.end(), 1); + std::iota(A.begin(), A.end(), 1.f); test_case.add_input(A); test_case.add_input({3.0f, 4.0f, 5.0f}); test_case.add_expected_output( @@ -4245,7 +4245,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_div_v6_broadcast_no_axis) { Shape shape{2, 2}; std::vector A(shape_size(shape)); - std::iota(A.begin(), A.end(), 1); + std::iota(A.begin(), A.end(), 1.f); test_case.add_input(A); test_case.add_input({2.0f}); test_case.add_expected_output(shape, {0.5f, 1.0f, 1.5f, 2.0f}); @@ -4270,7 +4270,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_div_v7_broadcast) { Shape shape{1, 2, 3}; std::vector A(shape_size(shape)); - std::iota(A.begin(), A.end(), 1); + std::iota(A.begin(), A.end(), 1.f); test_case.add_input(A); test_case.add_input({3.0f, 4.0f, 5.0f}); test_case.add_expected_output(shape, {0.3333333f, 0.5f, 0.6f, 1.3333333f, 1.25f, 1.2f}); diff --git a/src/frontends/onnx/tests/onnx_import_controlflow.in.cpp b/src/frontends/onnx/tests/onnx_import_controlflow.in.cpp index 5ae4fb25f5ea0f..80fe7f5fb27dd7 100644 --- a/src/frontends/onnx/tests/onnx_import_controlflow.in.cpp +++ b/src/frontends/onnx/tests/onnx_import_controlflow.in.cpp @@ -663,7 +663,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_if_inside_if) { // case when condition == true and all(x < y) // expected value == x + y std::iota(x.begin(), x.end(), -static_cast(x.size())); - std::iota(y.begin(), y.end(), 1); + std::iota(y.begin(), y.end(), 1.f); std::transform(x.begin(), x.end(), y.begin(), expected.begin(), [](float i, float j) -> float { return i + j; }); @@ -703,13 +703,13 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_if_branches_with_multiple_outputs) { // case when condition == true so split is along axis 0 std::vector x(36); - std::iota(x.begin(), x.end(), 0); + std::iota(x.begin(), x.end(), 0.f); std::vector expected1(12); - std::iota(expected1.begin(), expected1.end(), 0); + std::iota(expected1.begin(), expected1.end(), 0.f); std::vector expected2(12); - std::iota(expected2.begin(), expected2.end(), 12); + std::iota(expected2.begin(), expected2.end(), 12.f); std::vector expected3(12); - std::iota(expected3.begin(), expected3.end(), 24); + std::iota(expected3.begin(), expected3.end(), 24.f); test_case.add_input({true}); // condition test_case.add_input(x); test_case.add_expected_output(expected1); @@ -768,7 +768,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_if_with_only_indentity_in_else_branch) { auto test_case = test::TestCase(function, s_device); std::vector x(shape_size(Shape{1, 5, 2, 2})); - std::iota(x.begin(), x.end(), 0); + std::iota(x.begin(), x.end(), 0.f); std::vector expected{1.333333f, 3.f, 4.666666f, 6.333333f, 8.f, 10.f, 12.f, 14.f, 16.f, 18.f, 20.f, 22.f, 24.f, 26.f, 28.f, 30.f, 25.33333f, 27.f, 28.666667f, 30.33333f}; @@ -821,7 +821,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_if_dynamic_inputs) { auto test_case = test::TestCase(function, s_device); std::vector x(40, 2); std::vector y(40); - std::iota(y.begin(), y.end(), -20); + std::iota(y.begin(), y.end(), -20.f); std::vector expected; std::transform(x.begin(), x.end(), y.begin(), std::back_inserter(expected), [](float i, float j) -> float { return i + j; diff --git a/src/frontends/onnx/tests/onnx_import_dyn_shapes.in.cpp b/src/frontends/onnx/tests/onnx_import_dyn_shapes.in.cpp index 1adc51e123bb30..d9be2764a35631 100644 --- a/src/frontends/onnx/tests/onnx_import_dyn_shapes.in.cpp +++ b/src/frontends/onnx/tests/onnx_import_dyn_shapes.in.cpp @@ -93,7 +93,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_ab_plus_c_inference) { const auto elems_in_tensor = shape_size(shape); std::vector input_values(elems_in_tensor); - std::iota(input_values.begin(), input_values.end(), 1); + std::iota(input_values.begin(), input_values.end(), 1.f); test_case.add_input(shape, input_values); test_case.add_input(shape, input_values); @@ -754,7 +754,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_flatten_axis_0) { const auto elems_in_tensor = shape_size(shape); std::vector input_values(elems_in_tensor); - std::iota(input_values.begin(), input_values.end(), 1); + std::iota(input_values.begin(), input_values.end(), 1.f); test_case.add_input(shape, input_values); @@ -781,7 +781,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_flatten_axis) { const auto elems_in_tensor = shape_size(shape); std::vector input_values(elems_in_tensor); - std::iota(input_values.begin(), input_values.end(), 1); + std::iota(input_values.begin(), input_values.end(), 1.f); test_case.add_input(shape, input_values); @@ -808,7 +808,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_flatten_neg_axis) { const auto elems_in_tensor = shape_size(shape); std::vector input_values(elems_in_tensor); - std::iota(input_values.begin(), input_values.end(), 1); + std::iota(input_values.begin(), input_values.end(), 1.f); test_case.add_input(shape, input_values); @@ -910,7 +910,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_slice_10_3d_input) { const Shape input_shape{3, 4, 1}; std::vector input_values(shape_size(input_shape)); - std::iota(input_values.begin(), input_values.end(), 0); + std::iota(input_values.begin(), input_values.end(), 0.f); test_case.add_input(input_values); test_case.add_input({0, 0}); test_case.add_input({2, 3}); @@ -929,7 +929,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_slice_10_3d_input_neg_axes) { const Shape input_shape{3, 4, 1}; std::vector input_values(shape_size(input_shape)); - std::iota(input_values.begin(), input_values.end(), 0); + std::iota(input_values.begin(), input_values.end(), 0.f); test_case.add_input(input_values); test_case.add_input({0, 0}); test_case.add_input({2, 3}); @@ -948,7 +948,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_slice_10_3d_input_12_axes) { const Shape input_shape{4, 3, 2}; std::vector input_values(shape_size(input_shape)); - std::iota(input_values.begin(), input_values.end(), 0); + std::iota(input_values.begin(), input_values.end(), 0.f); test_case.add_input(input_values); test_case.add_input({0, 0}); test_case.add_input({2, 1}); @@ -966,7 +966,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_slice_10_3d_input_20_axes) { const Shape input_shape{4, 3, 2}; std::vector input_values(shape_size(input_shape)); - std::iota(input_values.begin(), input_values.end(), 0); + std::iota(input_values.begin(), input_values.end(), 0.f); test_case.add_input(input_shape, input_values); test_case.add_input({0, 1}); test_case.add_input({1, 3}); @@ -985,7 +985,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_slice_10_4d_input_23_axes) { const Shape input_shape{2, 2, 2, 2}; std::vector input_values(shape_size(input_shape)); - std::iota(input_values.begin(), input_values.end(), 0); + std::iota(input_values.begin(), input_values.end(), 0.f); test_case.add_input(input_values); test_case.add_input({0, 0}); test_case.add_input({1, 1}); @@ -1003,7 +1003,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_slice_10_4d_input_0231_axes_ends_ma const Shape input_shape{2, 2, 2, 2}; std::vector input_values(shape_size(input_shape)); - std::iota(input_values.begin(), input_values.end(), 0); + std::iota(input_values.begin(), input_values.end(), 0.f); test_case.add_input(input_values); test_case.add_input({0, 1, 1, 0}); test_case.add_input({std::numeric_limits::max(), @@ -1024,7 +1024,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_slice_10_4d_input_2103_axes_ends_ma const Shape input_shape{2, 2, 2, 5}; std::vector input_values(shape_size(input_shape)); - std::iota(input_values.begin(), input_values.end(), 0); + std::iota(input_values.begin(), input_values.end(), 0.f); test_case.add_input(input_values); test_case.add_input({1, 0, 0, 1}); test_case.add_input({2, @@ -1046,7 +1046,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_slice_10_4d_input_23_axes_21_steps) const Shape input_shape{2, 2, 6, 2}; std::vector input_values(shape_size(input_shape)); - std::iota(input_values.begin(), input_values.end(), 0); + std::iota(input_values.begin(), input_values.end(), 0.f); test_case.add_input(input_values); test_case.add_input({0, 1}); test_case.add_input({5, 2}); @@ -1063,7 +1063,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_slice_10_default_axes) { const Shape input_shape{4, 3, 2}; std::vector input_values(shape_size(input_shape)); - std::iota(input_values.begin(), input_values.end(), 0); + std::iota(input_values.begin(), input_values.end(), 0.f); test_case.add_input(input_values); test_case.add_input({1, 1, 1}); test_case.add_input({2, 2, 2}); @@ -1187,7 +1187,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_instance_normalization_dyn_shape) { Shape data_shape{1, 2, 3, 4}; std::vector data(shape_size(data_shape)); - std::iota(std::begin(data), std::end(data), 1); + std::iota(std::begin(data), std::end(data), 1.f); auto test_case = test::TestCase(function, s_device); @@ -1210,7 +1210,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_instance_normalization_dyn_shape2) { Shape data_shape{1, 2, 3, 4}; std::vector data(shape_size(data_shape)); - std::iota(std::begin(data), std::end(data), 1); + std::iota(std::begin(data), std::end(data), 1.f); auto test_case = test::TestCase(function, s_device); @@ -1278,7 +1278,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_slice_1_3d_input_21_axes_ends_max) const Shape input_shape{1, 2, 3, 4}; std::vector input_values(shape_size(input_shape)); - std::iota(input_values.begin(), input_values.end(), 0); + std::iota(input_values.begin(), input_values.end(), 0.f); test_case.add_input(input_shape, input_values); test_case.add_expected_output(Shape{1, 1, 3, 3}, {13, 14, 15, 17, 18, 19, 21, 22, 23}); test_case.run(); @@ -1318,7 +1318,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_max_pool_dyn_rank_without_default_attrs) Shape input_shape{1, 1, 4, 4}; std::vector input(shape_size(input_shape)); - std::iota(input.begin(), input.end(), 0); + std::iota(input.begin(), input.end(), 0.f); test_case.add_input(input_shape, input); test_case.add_expected_output(Shape{1, 1, 3, 3}, {5, 6, 7, 9, 10, 11, 13, 14, 15}); test_case.run(); @@ -1330,7 +1330,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_depth_to_space_dynamic_input) { "onnx/dynamic_shapes/depth_to_space.onnx")); std::vector input(32); - std::iota(input.begin(), input.end(), 0); + std::iota(input.begin(), input.end(), 0.f); std::vector expected_output{0.f, 8.f, 1.f, 9.f, 16.f, 24.f, 17.f, 25.f, 2.f, 10.f, 3.f, 11.f, 18.f, 26.f, 19.f, 27.f, 4.f, 12.f, 5.f, 13.f, 20.f, 28.f, @@ -1348,7 +1348,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_space_to_depth_dynamic_input) { "onnx/dynamic_shapes/space_to_depth.onnx")); std::vector input(32); - std::iota(input.begin(), input.end(), 0); + std::iota(input.begin(), input.end(), 0.f); std::vector expected_output{ 0.f, 2.f, 8.f, 10.f, 16.f, 18.f, 24.f, 26.f, 1.f, 3.f, 9.f, 11.f, 17.f, 19.f, 25.f, 27.f, diff --git a/src/frontends/onnx/tests/onnx_import_org_openvino.in.cpp b/src/frontends/onnx/tests/onnx_import_org_openvino.in.cpp index 6c29ef6b6c550d..cceb02a777fa8c 100644 --- a/src/frontends/onnx/tests/onnx_import_org_openvino.in.cpp +++ b/src/frontends/onnx/tests/onnx_import_org_openvino.in.cpp @@ -214,7 +214,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_group_norm_5d) { Shape shape{2, 8, 1, 2, 1}; int size = shape_size(shape); std::vector data(size); - std::iota(data.begin(), data.end(), 0); + std::iota(data.begin(), data.end(), 0.f); std::vector output = {-0.34163546562f, 0.55278813838f, 2.89442372322f, 4.68327093124f, -1.02490639686f, 1.65836453437f, 5.78884744644f, 9.36654186248f, -1.70817732810f, 2.76394081115f, 8.68327140808f, 14.04981231689f, -2.39144825935f, 3.86951708793f, 11.57769489288f, @@ -233,7 +233,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_normalize) { file_util::path_join(CommonTestUtils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/normalize.onnx")); auto test_case = test::TestCase(function, s_device); std::vector data(12); - std::iota(data.begin(), data.end(), 1); + std::iota(data.begin(), data.end(), 1.f); std::vector output = { 0.19334731f, 0.33806169f, @@ -443,7 +443,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_experimental_detectron_group_norm) { Shape shape{2, 8, 2, 2}; int size = shape_size(shape); std::vector data(size); - std::iota(data.begin(), data.end(), 0); + std::iota(data.begin(), data.end(), 0.f); std::vector output = { -0.52752507f, -0.09108937f, 0.3453464f, 0.78178215f, 2.4364357f, 3.309307f, 4.1821785f, 5.05505f, -1.5825753f, -0.27326822f, 1.0360391f, 2.3453465f, 4.8728714f, 6.618614f, 8.364357f, 10.1101f, @@ -469,13 +469,13 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_experimental_detectron_prior_grid_genera auto test_case = test::TestCase(function, s_device); std::vector priors(shape_size(Shape{3, 4})); - std::iota(priors.begin(), priors.end(), 0); + std::iota(priors.begin(), priors.end(), 0.f); std::vector feature_map(shape_size(Shape{1, 1, 1, 3})); - std::iota(feature_map.begin(), feature_map.end(), 0); + std::iota(feature_map.begin(), feature_map.end(), 0.f); std::vector im_data(shape_size(Shape{1, 3, 4, 7})); - std::iota(im_data.begin(), im_data.end(), 0); + std::iota(im_data.begin(), im_data.end(), 0.f); test_case.add_input(priors); test_case.add_input(feature_map); @@ -496,10 +496,10 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_experimental_detectron_roi_feature_extra auto test_case = test::TestCase(function, s_device); std::vector rois(shape_size(Shape{2, 4})); - std::iota(rois.begin(), rois.end(), 0); + std::iota(rois.begin(), rois.end(), 0.f); std::vector pyramid_layer_0(shape_size(Shape{1, 2, 2, 3})); - std::iota(pyramid_layer_0.begin(), pyramid_layer_0.end(), 0); + std::iota(pyramid_layer_0.begin(), pyramid_layer_0.end(), 0.f); test_case.add_input(rois); test_case.add_input(pyramid_layer_0); diff --git a/src/frontends/onnx/tests/onnx_import_reshape.in.cpp b/src/frontends/onnx/tests/onnx_import_reshape.in.cpp index d7c553eee629bd..645ccd8cc4cea7 100644 --- a/src/frontends/onnx/tests/onnx_import_reshape.in.cpp +++ b/src/frontends/onnx/tests/onnx_import_reshape.in.cpp @@ -304,7 +304,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_space_to_depth) { file_util::path_join(CommonTestUtils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/space_to_depth.onnx")); std::vector input(32); - std::iota(input.begin(), input.end(), 0); + std::iota(input.begin(), input.end(), 0.f); std::vector expected_output{ 0.f, 2.f, 8.f, 10.f, 16.f, 18.f, 24.f, 26.f, 1.f, 3.f, 9.f, 11.f, 17.f, 19.f, 25.f, 27.f, From 635cb08ed3091379f80122e10bbd7aa62f695a39 Mon Sep 17 00:00:00 2001 From: Mateusz Bencer Date: Tue, 21 Mar 2023 10:21:52 +0100 Subject: [PATCH 22/28] float cast --- src/frontends/onnx/tests/onnx_import.in.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/frontends/onnx/tests/onnx_import.in.cpp b/src/frontends/onnx/tests/onnx_import.in.cpp index 871d32d322af49..ddfe1361486dca 100644 --- a/src/frontends/onnx/tests/onnx_import.in.cpp +++ b/src/frontends/onnx/tests/onnx_import.in.cpp @@ -4327,8 +4327,8 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_clip_no_min_no_max_inf) { std::numeric_limits::min(), std::numeric_limits::max(), std::numeric_limits::lowest(), - 0, - -1}; + 0.f, + -1.f}; const std::vector expected_output{std::numeric_limits::max(), std::numeric_limits::lowest(), @@ -4336,8 +4336,8 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_clip_no_min_no_max_inf) { std::numeric_limits::min(), std::numeric_limits::max(), std::numeric_limits::lowest(), - 0, - -1}; + 0.f, + -1.f}; test_case.add_input(data); From 6647d92fb49905fe243f014ddc696c87c2c1070a Mon Sep 17 00:00:00 2001 From: Mateusz Bencer Date: Tue, 21 Mar 2023 20:20:57 +0100 Subject: [PATCH 23/28] fix float cast --- src/frontends/onnx/tests/onnx_import.in.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontends/onnx/tests/onnx_import.in.cpp b/src/frontends/onnx/tests/onnx_import.in.cpp index ddfe1361486dca..c15b20e7e3cc8e 100644 --- a/src/frontends/onnx/tests/onnx_import.in.cpp +++ b/src/frontends/onnx/tests/onnx_import.in.cpp @@ -4323,7 +4323,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_clip_no_min_no_max_inf) { auto test_case = test::TestCase(function, s_device); const std::vector data{std::numeric_limits::infinity(), -std::numeric_limits::infinity(), - static_cast(std::numeric_limits::max()), + static_cast(std::numeric_limits::max()), std::numeric_limits::min(), std::numeric_limits::max(), std::numeric_limits::lowest(), From cb2f1766a7f3dc97a63dc7990ee30778cb916318 Mon Sep 17 00:00:00 2001 From: Mateusz Bencer Date: Wed, 22 Mar 2023 09:20:53 +0100 Subject: [PATCH 24/28] fix size_t cast --- src/frontends/onnx/tests/onnx_import_dyn_shapes.in.cpp | 2 +- src/frontends/onnx/tests/onnx_import_org_openvino.in.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/frontends/onnx/tests/onnx_import_dyn_shapes.in.cpp b/src/frontends/onnx/tests/onnx_import_dyn_shapes.in.cpp index d9be2764a35631..dfa888bb943ce9 100644 --- a/src/frontends/onnx/tests/onnx_import_dyn_shapes.in.cpp +++ b/src/frontends/onnx/tests/onnx_import_dyn_shapes.in.cpp @@ -93,7 +93,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_ab_plus_c_inference) { const auto elems_in_tensor = shape_size(shape); std::vector input_values(elems_in_tensor); - std::iota(input_values.begin(), input_values.end(), 1.f); + std::iota(input_values.begin(), input_values.end(), 1); test_case.add_input(shape, input_values); test_case.add_input(shape, input_values); diff --git a/src/frontends/onnx/tests/onnx_import_org_openvino.in.cpp b/src/frontends/onnx/tests/onnx_import_org_openvino.in.cpp index cceb02a777fa8c..909eb4bb7bf2fb 100644 --- a/src/frontends/onnx/tests/onnx_import_org_openvino.in.cpp +++ b/src/frontends/onnx/tests/onnx_import_org_openvino.in.cpp @@ -188,7 +188,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_group_norm) { file_util::path_join(CommonTestUtils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/group_norm.onnx")); auto test_case = test::TestCase(function, s_device); Shape shape{2, 8, 2, 2}; - int size = shape_size(shape); + const auto size = shape_size(shape); std::vector data(size); std::iota(data.begin(), data.end(), 0.f); std::vector output = { @@ -212,7 +212,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_group_norm_5d) { file_util::path_join(CommonTestUtils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/group_norm_5d.onnx")); auto test_case = test::TestCase(function, s_device); Shape shape{2, 8, 1, 2, 1}; - int size = shape_size(shape); + const auto size = shape_size(shape); std::vector data(size); std::iota(data.begin(), data.end(), 0.f); std::vector output = {-0.34163546562f, 0.55278813838f, 2.89442372322f, 4.68327093124f, -1.02490639686f, @@ -441,7 +441,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_experimental_detectron_group_norm) { auto test_case = test::TestCase(function, s_device); Shape shape{2, 8, 2, 2}; - int size = shape_size(shape); + const auto size = shape_size(shape); std::vector data(size); std::iota(data.begin(), data.end(), 0.f); std::vector output = { From 8c041e925f34596b8d3da9e6889820d254eadf0e Mon Sep 17 00:00:00 2001 From: Mateusz Bencer Date: Wed, 22 Mar 2023 11:42:44 +0100 Subject: [PATCH 25/28] float cast --- src/frontends/onnx/tests/onnx_import_controlflow.in.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/frontends/onnx/tests/onnx_import_controlflow.in.cpp b/src/frontends/onnx/tests/onnx_import_controlflow.in.cpp index 80fe7f5fb27dd7..3cf38e223d07ed 100644 --- a/src/frontends/onnx/tests/onnx_import_controlflow.in.cpp +++ b/src/frontends/onnx/tests/onnx_import_controlflow.in.cpp @@ -577,7 +577,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_if_branches_with_different_inputs) { auto test_case = test::TestCase(function, s_device); std::vector x(40, 2); std::vector y(40); - std::iota(y.begin(), y.end(), -20); + std::iota(y.begin(), y.end(), -20.f); // condition test_case.add_input({true}); @@ -649,7 +649,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_if_inside_if) { // expected value == x * y std::vector x(40, 2); std::vector y(40); - std::iota(y.begin(), y.end(), -20); + std::iota(y.begin(), y.end(), -20.f); std::vector expected; std::transform(x.begin(), x.end(), y.begin(), std::back_inserter(expected), [](float i, float j) -> float { return i * j; From 09818a02d01b9343c4c2e6ffa2e7103797f2cee1 Mon Sep 17 00:00:00 2001 From: Mateusz Bencer Date: Wed, 22 Mar 2023 12:57:13 +0100 Subject: [PATCH 26/28] cast in run_with_tolerance_as_fp --- src/frontends/onnx/tests/onnx_import.in.cpp | 2 +- .../onnx/tests/onnx_import_com_microsoft.in.cpp | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/frontends/onnx/tests/onnx_import.in.cpp b/src/frontends/onnx/tests/onnx_import.in.cpp index c15b20e7e3cc8e..b49861e1806fa7 100644 --- a/src/frontends/onnx/tests/onnx_import.in.cpp +++ b/src/frontends/onnx/tests/onnx_import.in.cpp @@ -4342,7 +4342,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_clip_no_min_no_max_inf) { test_case.add_input(data); test_case.add_expected_output(Shape{2, 4}, expected_output); - test_case.run_with_tolerance_as_fp(0); + test_case.run_with_tolerance_as_fp(0.f); } NGRAPH_TEST(${BACKEND_NAME}, onnx_clip_no_min_set_max) { diff --git a/src/frontends/onnx/tests/onnx_import_com_microsoft.in.cpp b/src/frontends/onnx/tests/onnx_import_com_microsoft.in.cpp index 8d9d6fbe40a8be..2fda21990d3d31 100644 --- a/src/frontends/onnx/tests/onnx_import_com_microsoft.in.cpp +++ b/src/frontends/onnx/tests/onnx_import_com_microsoft.in.cpp @@ -829,7 +829,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_attention_mask_index_3) { test_case.add_input(mask); test_case.add_expected_output(output); test_case.add_expected_output(present); - test_case.run_with_tolerance_as_fp(1e-7); + test_case.run_with_tolerance_as_fp(1e-7f); } NGRAPH_TEST(${BACKEND_NAME}, onnx_model_attention_mask_index_4) { @@ -868,7 +868,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_attention_mask_index_4) { test_case.add_input(mask); test_case.add_expected_output(output); test_case.add_expected_output(present); - test_case.run_with_tolerance_as_fp(1e-7); + test_case.run_with_tolerance_as_fp(1e-7f); } NGRAPH_TEST(${BACKEND_NAME}, onnx_model_attention_past) { @@ -947,7 +947,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_attention_past) { test_case.add_input(past); test_case.add_expected_output(output); test_case.add_expected_output(present); - test_case.run_with_tolerance_as_fp(1e-6); + test_case.run_with_tolerance_as_fp(1e-6f); } NGRAPH_TEST(${BACKEND_NAME}, onnx_model_attention_extra_add) { @@ -1004,7 +1004,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_attention_extra_add) { test_case.add_input(extra_add); test_case.add_expected_output(output); test_case.add_expected_output(present); - test_case.run_with_tolerance_as_fp(1e-7); + test_case.run_with_tolerance_as_fp(1e-7f); } NGRAPH_TEST(${BACKEND_NAME}, onnx_model_attention_dynamic_shapes) { @@ -1106,7 +1106,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_attention_dynamic_shapes) { test_case.add_input(Shape{2, 2, 2, 5, 2}, past); test_case.add_expected_output(Shape{2, 4, 4}, output); test_case.add_expected_output(Shape{2, 2, 2, 9, 2}, present); - test_case.run_with_tolerance_as_fp(1e-6); + test_case.run_with_tolerance_as_fp(1e-6f); } NGRAPH_TEST(${BACKEND_NAME}, onnx_model_fusedgemm_abc) { @@ -1177,7 +1177,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_fusedgemm_abc) { test_case.add_input(Shape{6, 4}, inputB); test_case.add_input(Shape{3, 4}, inputC); test_case.add_expected_output(Shape{3, 4}, output); - test_case.run_with_tolerance_as_fp(1e-6); + test_case.run_with_tolerance_as_fp(1e-6f); } NGRAPH_TEST(${BACKEND_NAME}, onnx_com_microsoft_fused_conv_hard_sigmoid) { From 03ed69161d93d570a5d0e88c6cd112b2bb5b6aa9 Mon Sep 17 00:00:00 2001 From: Mateusz Bencer Date: Wed, 22 Mar 2023 15:21:23 +0100 Subject: [PATCH 27/28] fix run_with_tolerance_as_fp cast --- .../onnx/tests/onnx_import_com_microsoft.in.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/frontends/onnx/tests/onnx_import_com_microsoft.in.cpp b/src/frontends/onnx/tests/onnx_import_com_microsoft.in.cpp index 2fda21990d3d31..e231334cfc87e8 100644 --- a/src/frontends/onnx/tests/onnx_import_com_microsoft.in.cpp +++ b/src/frontends/onnx/tests/onnx_import_com_microsoft.in.cpp @@ -265,7 +265,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_embed_layer_normalization_with_segment_e test_case.add_input(segment_ids); test_case.add_expected_output(expected_output); test_case.add_expected_output(expected_mask_index); - test_case.run_with_tolerance_as_fp(1e-7); + test_case.run_with_tolerance_as_fp(1e-7f); } NGRAPH_TEST(${BACKEND_NAME}, onnx_model_embed_layer_normalization_with_segment_embedding_and_mask) { @@ -312,7 +312,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_embed_layer_normalization_with_segment_e test_case.add_input(mask); test_case.add_expected_output(expected_output); test_case.add_expected_output(expected_mask_index); - test_case.run_with_tolerance_as_fp(1e-7); + test_case.run_with_tolerance_as_fp(1e-7f); } NGRAPH_TEST(${BACKEND_NAME}, onnx_model_embed_layer_normalization_dynamic_shapes) { @@ -411,7 +411,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_embed_layer_normalization_dynamic_shapes test_case.add_input(Shape{3, 8}, mask); test_case.add_expected_output(Shape{3, 8, 5}, expected_output); test_case.add_expected_output(Shape{3}, expected_mask_index); - test_case.run_with_tolerance_as_fp(1e-6); + test_case.run_with_tolerance_as_fp(1e-6f); } NGRAPH_TEST(${BACKEND_NAME}, onnx_model_embed_layer_normalization_diff_seq_len_pos_embed_len) { @@ -511,7 +511,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_embed_layer_normalization_diff_seq_len_p test_case.add_input(Shape{3, 8}, mask); test_case.add_expected_output(Shape{3, 8, 5}, expected_output); test_case.add_expected_output(Shape{3}, expected_mask_index); - test_case.run_with_tolerance_as_fp(1e-6); + test_case.run_with_tolerance_as_fp(1e-6f); } NGRAPH_TEST(${BACKEND_NAME}, onnx_model_embed_layer_normalization_with_position_ids) { @@ -615,7 +615,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_embed_layer_normalization_with_position_ test_case.add_input(Shape{3, 8}, position_ids); test_case.add_expected_output(Shape{3, 8, 5}, expected_output); test_case.add_expected_output(Shape{3}, expected_mask_index); - test_case.run_with_tolerance_as_fp(1e-6); + test_case.run_with_tolerance_as_fp(1e-6f); } NGRAPH_TEST(${BACKEND_NAME}, onnx_model_attention) { From a5924c70741bbf8057e9dcc3e99bcbed134c7431 Mon Sep 17 00:00:00 2001 From: Mateusz Bencer Date: Wed, 22 Mar 2023 16:44:35 +0100 Subject: [PATCH 28/28] size_t -> int cast --- src/frontends/onnx/tests/onnx_transformations.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontends/onnx/tests/onnx_transformations.cpp b/src/frontends/onnx/tests/onnx_transformations.cpp index 76420f41e314c3..ca4535c921ff76 100644 --- a/src/frontends/onnx/tests/onnx_transformations.cpp +++ b/src/frontends/onnx/tests/onnx_transformations.cpp @@ -42,7 +42,7 @@ bool after_func_expand_name_comp(std::string lhs, std::string rhs) { if (is_hex_symbol(name[i])) { ++founded_hex; if (cut_begin == -1) { - cut_begin = i; + cut_begin = static_cast(i); } if (founded_hex >= min_address) { cut_length = founded_hex;