Refactor engines utils. Delete the target (#18916)
* Refactor engines utils. Delete the target * Apply comments
This commit is contained in:
parent
a3bb0a8cc7
commit
74c778e7ee
@ -38,7 +38,6 @@ ov_add_test_target(
|
||||
# process models
|
||||
test_model_zoo
|
||||
LINK_LIBRARIES
|
||||
engines_test_util
|
||||
common_test_utils
|
||||
ngraph_reference
|
||||
ngraph::builder
|
||||
|
@ -11,7 +11,6 @@
|
||||
#include "common_test_utils/all_close.hpp"
|
||||
#include "common_test_utils/ndarray.hpp"
|
||||
#include "common_test_utils/test_tools.hpp"
|
||||
#include "engines_util/execute_tools.hpp"
|
||||
#include "gtest/gtest.h"
|
||||
#include "ngraph/file_util.hpp"
|
||||
#include "ngraph/graph_util.hpp"
|
||||
@ -53,6 +52,36 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
::testing::AssertionResult test_ordered_ops(const std::shared_ptr<ov::Model>& m, const ov::NodeVector& required_ops) {
|
||||
std::unordered_set<ov::Node*> seen;
|
||||
for (auto& node_ptr : m->get_ordered_ops()) {
|
||||
ov::Node* node = node_ptr.get();
|
||||
if (seen.count(node) > 0) {
|
||||
return ::testing::AssertionFailure() << "Duplication in ordered ops";
|
||||
}
|
||||
size_t arg_count = node->get_input_size();
|
||||
for (size_t i = 0; i < arg_count; ++i) {
|
||||
ov::Node* dep = node->get_input_node_ptr(i);
|
||||
if (seen.count(dep) == 0) {
|
||||
return ::testing::AssertionFailure() << "Argument " << *dep << " does not occur before op" << *node;
|
||||
}
|
||||
}
|
||||
for (auto& dep_ptr : node->get_control_dependencies()) {
|
||||
if (seen.count(dep_ptr.get()) == 0) {
|
||||
return ::testing::AssertionFailure()
|
||||
<< "Control dependency " << *dep_ptr << " does not occur before op" << *node;
|
||||
}
|
||||
}
|
||||
seen.insert(node);
|
||||
}
|
||||
for (auto& node_ptr : required_ops) {
|
||||
if (seen.count(node_ptr.get()) == 0) {
|
||||
return ::testing::AssertionFailure() << "Required op " << *node_ptr << "does not occur in ordered ops";
|
||||
}
|
||||
}
|
||||
return ::testing::AssertionSuccess();
|
||||
}
|
||||
|
||||
TEST(control_dependencies, cdep_ops) {
|
||||
auto A = make_shared<op::Parameter>(element::f32, Shape{});
|
||||
auto B = make_shared<op::Parameter>(element::f32, Shape{});
|
||||
|
@ -7,7 +7,6 @@
|
||||
|
||||
#include "common_test_utils/ndarray.hpp"
|
||||
#include "common_test_utils/test_tools.hpp"
|
||||
#include "engines_util/execute_tools.hpp"
|
||||
#include "gtest/gtest.h"
|
||||
#include "ngraph/ngraph.hpp"
|
||||
#include "ngraph/opsets/opset5.hpp"
|
||||
|
@ -9,10 +9,9 @@
|
||||
|
||||
#include "common_test_utils/ndarray.hpp"
|
||||
#include "common_test_utils/test_assertions.hpp"
|
||||
#include "common_test_utils/test_case.hpp"
|
||||
#include "common_test_utils/test_tools.hpp"
|
||||
#include "common_test_utils/type_prop.hpp"
|
||||
#include "engines_util/execute_tools.hpp"
|
||||
#include "engines_util/test_case.hpp"
|
||||
#include "gmock/gmock.h"
|
||||
#include "gtest/gtest.h"
|
||||
#include "ngraph/node.hpp"
|
||||
@ -66,6 +65,7 @@
|
||||
#include "ngraph/runtime/host_tensor.hpp"
|
||||
#include "ngraph/validation_util.hpp"
|
||||
#include "sequnce_generator.hpp"
|
||||
#include "utils/eval_utils.hpp"
|
||||
|
||||
NGRAPH_SUPPRESS_DEPRECATED_START
|
||||
|
||||
|
@ -8,7 +8,6 @@
|
||||
#include <vector>
|
||||
|
||||
#include "common_test_utils/test_tools.hpp"
|
||||
#include "engines_util/execute_tools.hpp"
|
||||
#include "gtest/gtest.h"
|
||||
#include "ngraph/graph_util.hpp"
|
||||
#include "ngraph/ngraph.hpp"
|
||||
@ -19,6 +18,57 @@ using namespace std;
|
||||
|
||||
OPENVINO_SUPPRESS_DEPRECATED_START
|
||||
|
||||
std::shared_ptr<ov::Model> make_test_graph() {
|
||||
auto arg_0 = std::make_shared<ov::op::v0::Parameter>(ov::element::f32, ov::Shape{2, 2});
|
||||
auto arg_1 = std::make_shared<ov::op::v0::Parameter>(ov::element::f32, ov::Shape{2, 2});
|
||||
auto arg_2 = std::make_shared<ov::op::v0::Parameter>(ov::element::f32, ov::Shape{2, 2});
|
||||
auto arg_3 = std::make_shared<ov::op::v0::Parameter>(ov::element::f32, ov::Shape{2, 2});
|
||||
auto arg_4 = std::make_shared<ov::op::v0::Parameter>(ov::element::f32, ov::Shape{2, 2});
|
||||
auto arg_5 = std::make_shared<ov::op::v0::Parameter>(ov::element::f32, ov::Shape{2, 2});
|
||||
|
||||
auto t0 = std::make_shared<ov::op::v1::Add>(arg_0, arg_1);
|
||||
auto t1 = std::make_shared<ov::op::v0::MatMul>(t0, arg_2);
|
||||
auto t2 = std::make_shared<ov::op::v1::Multiply>(t0, arg_3);
|
||||
|
||||
auto t3 = std::make_shared<ov::op::v1::Add>(t1, arg_4);
|
||||
auto t4 = std::make_shared<ov::op::v1::Add>(t2, arg_5);
|
||||
|
||||
auto r0 = std::make_shared<ov::op::v1::Add>(t3, t4);
|
||||
|
||||
auto m = std::make_shared<ov::Model>(r0, ov::ParameterVector{arg_0, arg_1, arg_2, arg_3, arg_4, arg_5});
|
||||
|
||||
return m;
|
||||
}
|
||||
|
||||
// This function traverses the vector of ops and verifies that each op's dependencies (its inputs)
|
||||
// is located earlier in the vector. That is enough to be valid
|
||||
bool validate_list(const std::vector<std::shared_ptr<ov::Node>>& nodes) {
|
||||
bool rc = true;
|
||||
for (auto it = nodes.rbegin(); it != nodes.rend(); it++) {
|
||||
auto node_tmp = *it;
|
||||
ov::NodeVector dependencies_tmp;
|
||||
for (auto& val : node_tmp->input_values())
|
||||
dependencies_tmp.emplace_back(val.get_node_shared_ptr());
|
||||
std::vector<ov::Node*> dependencies;
|
||||
|
||||
for (std::shared_ptr<ov::Node> n : dependencies_tmp) {
|
||||
dependencies.push_back(n.get());
|
||||
}
|
||||
auto tmp = it;
|
||||
for (tmp++; tmp != nodes.rend(); tmp++) {
|
||||
auto dep_tmp = *tmp;
|
||||
auto found = find(dependencies.begin(), dependencies.end(), dep_tmp.get());
|
||||
if (found != dependencies.end()) {
|
||||
dependencies.erase(found);
|
||||
}
|
||||
}
|
||||
if (dependencies.size() > 0) {
|
||||
rc = false;
|
||||
}
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
TEST(pass_manager, add) {
|
||||
pass::Manager pass_manager;
|
||||
|
||||
|
137
src/core/tests/utils/eval_utils.hpp
Normal file
137
src/core/tests/utils/eval_utils.hpp
Normal file
@ -0,0 +1,137 @@
|
||||
// Copyright (C) 2018-2023 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <random>
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
#include "ngraph/runtime/host_tensor.hpp"
|
||||
#include "openvino/core/node.hpp"
|
||||
#include "openvino/core/shape.hpp"
|
||||
|
||||
OPENVINO_SUPPRESS_DEPRECATED_START
|
||||
namespace {
|
||||
template <typename T>
|
||||
void copy_data(const std::shared_ptr<ngraph::runtime::Tensor>& tv, const std::vector<T>& data) {
|
||||
size_t data_size = data.size() * sizeof(T);
|
||||
if (data_size > 0) {
|
||||
tv->write(data.data(), data_size);
|
||||
}
|
||||
}
|
||||
|
||||
template <>
|
||||
inline void copy_data<bool>(const std::shared_ptr<ngraph::runtime::Tensor>& tv, const std::vector<bool>& data) {
|
||||
std::vector<char> data_char(data.begin(), data.end());
|
||||
copy_data(tv, data_char);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void init_int_tv(ngraph::runtime::Tensor* tv, std::default_random_engine& engine, T min, T max) {
|
||||
size_t size = tv->get_element_count();
|
||||
std::uniform_int_distribution<T> dist(min, max);
|
||||
std::vector<T> vec(size);
|
||||
for (T& element : vec) {
|
||||
element = dist(engine);
|
||||
}
|
||||
tv->write(vec.data(), vec.size() * sizeof(T));
|
||||
}
|
||||
|
||||
template <>
|
||||
inline void init_int_tv<char>(ngraph::runtime::Tensor* tv, std::default_random_engine& engine, char min, char max) {
|
||||
size_t size = tv->get_element_count();
|
||||
std::uniform_int_distribution<int16_t> dist(static_cast<short>(min), static_cast<short>(max));
|
||||
std::vector<char> vec(size);
|
||||
for (char& element : vec) {
|
||||
element = static_cast<char>(dist(engine));
|
||||
}
|
||||
tv->write(vec.data(), vec.size() * sizeof(char));
|
||||
}
|
||||
|
||||
template <>
|
||||
inline void init_int_tv<int8_t>(ngraph::runtime::Tensor* tv,
|
||||
std::default_random_engine& engine,
|
||||
int8_t min,
|
||||
int8_t max) {
|
||||
size_t size = tv->get_element_count();
|
||||
std::uniform_int_distribution<int16_t> dist(static_cast<short>(min), static_cast<short>(max));
|
||||
std::vector<int8_t> vec(size);
|
||||
for (int8_t& element : vec) {
|
||||
element = static_cast<int8_t>(dist(engine));
|
||||
}
|
||||
tv->write(vec.data(), vec.size() * sizeof(int8_t));
|
||||
}
|
||||
|
||||
template <>
|
||||
inline void init_int_tv<uint8_t>(ngraph::runtime::Tensor* tv,
|
||||
std::default_random_engine& engine,
|
||||
uint8_t min,
|
||||
uint8_t max) {
|
||||
size_t size = tv->get_element_count();
|
||||
std::uniform_int_distribution<int16_t> dist(static_cast<short>(min), static_cast<short>(max));
|
||||
std::vector<uint8_t> vec(size);
|
||||
for (uint8_t& element : vec) {
|
||||
element = static_cast<uint8_t>(dist(engine));
|
||||
}
|
||||
tv->write(vec.data(), vec.size() * sizeof(uint8_t));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void init_real_tv(ngraph::runtime::Tensor* tv, std::default_random_engine& engine, T min, T max) {
|
||||
size_t size = tv->get_element_count();
|
||||
std::uniform_real_distribution<T> dist(min, max);
|
||||
std::vector<T> vec(size);
|
||||
for (T& element : vec) {
|
||||
element = dist(engine);
|
||||
}
|
||||
tv->write(vec.data(), vec.size() * sizeof(T));
|
||||
}
|
||||
|
||||
inline void random_init(ngraph::runtime::Tensor* tv, std::default_random_engine& engine) {
|
||||
ov::element::Type et = tv->get_element_type();
|
||||
if (et == ov::element::boolean) {
|
||||
init_int_tv<char>(tv, engine, 0, 1);
|
||||
} else if (et == ov::element::f32) {
|
||||
init_real_tv<float>(tv, engine, std::numeric_limits<float>::min(), 1.0f);
|
||||
} else if (et == ov::element::f64) {
|
||||
init_real_tv<double>(tv, engine, std::numeric_limits<double>::min(), 1.0);
|
||||
} else if (et == ov::element::i8) {
|
||||
init_int_tv<int8_t>(tv, engine, -1, 1);
|
||||
} else if (et == ov::element::i16) {
|
||||
init_int_tv<int16_t>(tv, engine, -1, 1);
|
||||
} else if (et == ov::element::i32) {
|
||||
init_int_tv<int32_t>(tv, engine, 0, 1);
|
||||
} else if (et == ov::element::i64) {
|
||||
init_int_tv<int64_t>(tv, engine, 0, 1);
|
||||
} else if (et == ov::element::u8) {
|
||||
init_int_tv<uint8_t>(tv, engine, 0, 1);
|
||||
} else if (et == ov::element::u16) {
|
||||
init_int_tv<uint16_t>(tv, engine, 0, 1);
|
||||
} else if (et == ov::element::u32) {
|
||||
init_int_tv<uint32_t>(tv, engine, 0, 1);
|
||||
} else if (et == ov::element::u64) {
|
||||
init_int_tv<uint64_t>(tv, engine, 0, 1);
|
||||
} else {
|
||||
OPENVINO_THROW("unsupported type");
|
||||
}
|
||||
}
|
||||
} // namespace
|
||||
|
||||
template <ov::element::Type_t ET>
|
||||
ngraph::HostTensorPtr make_host_tensor(const ov::Shape& shape,
|
||||
const std::vector<typename ov::element_type_traits<ET>::value_type>& data) {
|
||||
OPENVINO_ASSERT(shape_size(shape) == data.size(), "Incorrect number of initialization elements");
|
||||
auto host_tensor = std::make_shared<ngraph::runtime::HostTensor>(ET, shape);
|
||||
copy_data(host_tensor, data);
|
||||
return host_tensor;
|
||||
}
|
||||
|
||||
template <ov::element::Type_t ET>
|
||||
ngraph::HostTensorPtr make_host_tensor(const ov::Shape& shape) {
|
||||
auto host_tensor = std::make_shared<ngraph::runtime::HostTensor>(ET, shape);
|
||||
static std::default_random_engine engine(2112);
|
||||
random_init(host_tensor.get(), engine);
|
||||
return host_tensor;
|
||||
}
|
||||
OPENVINO_SUPPRESS_DEPRECATED_END
|
@ -137,7 +137,7 @@ if(ONNX_TESTS_DEPENDENCIES)
|
||||
add_dependencies(ov_onnx_frontend_tests ${ONNX_TESTS_DEPENDENCIES})
|
||||
endif()
|
||||
|
||||
target_link_libraries(ov_onnx_frontend_tests PRIVATE engines_test_util gtest_main_manifest openvino::runtime::dev
|
||||
target_link_libraries(ov_onnx_frontend_tests PRIVATE gtest_main_manifest openvino::runtime::dev
|
||||
openvino_onnx_frontend onnx_common func_test_utils)
|
||||
|
||||
# It's needed by onnx_import_library.cpp and onnx_import_exceptions.cpp tests to include onnx_pb.h.
|
||||
|
@ -6,10 +6,10 @@
|
||||
#include <sstream>
|
||||
|
||||
#include "common_test_utils/file_utils.hpp"
|
||||
#include "common_test_utils/test_case.hpp"
|
||||
#include "common_test_utils/test_control.hpp"
|
||||
#include "default_opset.hpp"
|
||||
#include "editor.hpp"
|
||||
#include "engines_util/test_case.hpp"
|
||||
#include "gtest/gtest.h"
|
||||
#include "ngraph/file_util.hpp"
|
||||
#include "ngraph/op/util/op_types.hpp"
|
||||
@ -1356,7 +1356,7 @@ OPENVINO_TEST(onnx_editor, values__append_one_initializer) {
|
||||
editor.set_input_values(in_vals);
|
||||
|
||||
const auto function = editor.get_function();
|
||||
auto test_case = ngraph::test::TestCase(function);
|
||||
auto test_case = ov::test::TestCase(function);
|
||||
test_case.add_input<int64_t>(Shape{2}, {5, 6});
|
||||
test_case.add_expected_output<int64_t>(Shape{2}, {6, 8});
|
||||
test_case.run();
|
||||
@ -1373,7 +1373,7 @@ OPENVINO_TEST(onnx_editor, values__append_two_initializers_to_invalid) {
|
||||
editor.set_input_values(in_vals);
|
||||
|
||||
const auto function = editor.get_function();
|
||||
auto test_case = ngraph::test::TestCase(function);
|
||||
auto test_case = ov::test::TestCase(function);
|
||||
test_case.add_expected_output<int64_t>(Shape{2}, {5, 5});
|
||||
test_case.run();
|
||||
}
|
||||
@ -1389,7 +1389,7 @@ OPENVINO_TEST(onnx_editor, values__modify_one_initializer) {
|
||||
editor.set_input_values(in_vals);
|
||||
|
||||
const auto function = editor.get_function();
|
||||
auto test_case = ngraph::test::TestCase(function);
|
||||
auto test_case = ov::test::TestCase(function);
|
||||
test_case.add_expected_output<int64_t>(Shape{2}, {4, 6});
|
||||
test_case.run();
|
||||
}
|
||||
@ -1406,7 +1406,7 @@ OPENVINO_TEST(onnx_editor, values__modify_two_initializers) {
|
||||
editor.set_input_values(in_vals);
|
||||
|
||||
const auto function = editor.get_function();
|
||||
auto test_case = ngraph::test::TestCase(function);
|
||||
auto test_case = ov::test::TestCase(function);
|
||||
test_case.add_expected_output<int64_t>(Shape{2}, {5, 7});
|
||||
test_case.run();
|
||||
}
|
||||
@ -1423,7 +1423,7 @@ OPENVINO_TEST(onnx_editor, values__no_inputs_modify_two_initializers) {
|
||||
editor.set_input_values(in_vals);
|
||||
|
||||
const auto function = editor.get_function();
|
||||
auto test_case = ngraph::test::TestCase(function);
|
||||
auto test_case = ov::test::TestCase(function);
|
||||
test_case.add_expected_output<int64_t>(Shape{2}, {12, 24});
|
||||
test_case.run();
|
||||
}
|
||||
@ -1439,7 +1439,7 @@ OPENVINO_TEST(onnx_editor, values__append_two_initializers_change_shape_type) {
|
||||
editor.set_input_values(in_vals);
|
||||
|
||||
const auto function = editor.get_function();
|
||||
auto test_case = ngraph::test::TestCase(function);
|
||||
auto test_case = ov::test::TestCase(function);
|
||||
test_case.add_expected_output<int8_t>(Shape{2, 1}, {-3, 3});
|
||||
test_case.run();
|
||||
}
|
||||
@ -1455,7 +1455,7 @@ OPENVINO_TEST(onnx_editor, values__append_two_initializers_mixed_types) {
|
||||
editor.set_input_values(in_vals);
|
||||
|
||||
const auto function = editor.get_function();
|
||||
auto test_case = ngraph::test::TestCase(function);
|
||||
auto test_case = ov::test::TestCase(function);
|
||||
test_case.add_expected_output<int16_t>(Shape{2, 2, 1}, {1, 4, 5, 8});
|
||||
test_case.run();
|
||||
}
|
||||
@ -1468,7 +1468,7 @@ OPENVINO_TEST(onnx_editor, read_model_from_stream) {
|
||||
ASSERT_TRUE(stream.is_open());
|
||||
ONNXModelEditor editor{stream, path};
|
||||
|
||||
auto test_case = ngraph::test::TestCase(editor.get_function());
|
||||
auto test_case = ov::test::TestCase(editor.get_function());
|
||||
test_case.add_input<float>({1.f, 2.f, 3.f, 4.f});
|
||||
test_case.add_expected_output<float>(Shape{2, 2}, {3.f, 6.f, 9.f, 12.f});
|
||||
|
||||
|
@ -5,9 +5,9 @@
|
||||
#include <algorithm>
|
||||
|
||||
#include "common_test_utils/file_utils.hpp"
|
||||
#include "common_test_utils/test_case.hpp"
|
||||
#include "common_test_utils/test_control.hpp"
|
||||
#include "editor.hpp"
|
||||
#include "engines_util/test_case.hpp"
|
||||
#include "gtest/gtest.h"
|
||||
#include "ngraph/file_util.hpp"
|
||||
#include "onnx_test_util.hpp"
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -15,8 +15,9 @@
|
||||
|
||||
#include "common_test_utils/file_utils.hpp"
|
||||
#include "default_opset.hpp"
|
||||
#include "engines_util/test_case.hpp"
|
||||
#include "common_test_utils/test_case.hpp"
|
||||
#include "onnx_import/onnx.hpp"
|
||||
#include "onnx_utils.hpp"
|
||||
#include "common_test_utils/test_control.hpp"
|
||||
|
||||
OPENVINO_SUPPRESS_DEPRECATED_START
|
||||
@ -24,14 +25,14 @@ OPENVINO_SUPPRESS_DEPRECATED_START
|
||||
using namespace ngraph;
|
||||
|
||||
static std::string s_manifest = "${MANIFEST}";
|
||||
static std::string s_device = test::backend_name_to_device("${BACKEND_NAME}");
|
||||
static std::string s_device = backend_name_to_device("${BACKEND_NAME}");
|
||||
|
||||
OPENVINO_TEST(${BACKEND_NAME}, onnx_model_bias_gelu) {
|
||||
const auto function = onnx_import::import_onnx_model(file_util::path_join(ov::test::utils::getExecutableDirectory(),
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/com.microsoft/bias_gelu.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>({0.5488135f,
|
||||
0.71518934f,
|
||||
0.60276335f,
|
||||
@ -77,7 +78,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_skip_layer_normalization_with_gamma_be
|
||||
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);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>(input);
|
||||
test_case.add_input<float>(skip);
|
||||
test_case.add_expected_output<float>(expected);
|
||||
@ -105,7 +106,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_skip_layer_normalization_with_gamma_be
|
||||
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);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>(input);
|
||||
test_case.add_input<float>(skip);
|
||||
test_case.add_expected_output<float>(expected);
|
||||
@ -133,7 +134,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_skip_layer_normalization_with_gamma) {
|
||||
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);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>(input);
|
||||
test_case.add_input<float>(skip);
|
||||
test_case.add_expected_output<float>(expected);
|
||||
@ -180,7 +181,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_skip_layer_normalization_dynamic_shape
|
||||
0.64228040f, 0.21059875f, 1.05966032f, -0.14278713f, 1.46366918f, 0.21215858f, -0.31640187f, -0.22832340f,
|
||||
};
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>(Shape{3, 2, 4}, input);
|
||||
test_case.add_input<float>(Shape{3, 2, 4}, skip);
|
||||
test_case.add_input<float>(Shape{4}, gamma);
|
||||
@ -217,7 +218,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_embed_layer_normalization) {
|
||||
-0.03054028f, -0.03603891f, -0.08479506f, -0.00034568f, 0.03713699f, 0.00163411f, -0.01738501f, -0.18267182f,
|
||||
};
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<int>(input_ids);
|
||||
test_case.add_expected_output<float>(expected_output);
|
||||
test_case.run_with_tolerance_as_fp(1e-7f);
|
||||
@ -259,7 +260,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_embed_layer_normalization_with_segment
|
||||
0,
|
||||
};
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<int>(input_ids);
|
||||
test_case.add_input<int>(segment_ids);
|
||||
test_case.add_expected_output<float>(expected_output);
|
||||
@ -305,7 +306,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_embed_layer_normalization_with_segment
|
||||
4,
|
||||
};
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<int>(input_ids);
|
||||
test_case.add_input<int>(segment_ids);
|
||||
test_case.add_input<int>(mask);
|
||||
@ -399,7 +400,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_embed_layer_normalization_dynamic_shap
|
||||
5,
|
||||
};
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<int>(Shape{3, 8}, input_ids);
|
||||
test_case.add_input<int>(Shape{3, 8}, segment_ids);
|
||||
test_case.add_input<float>(Shape{10, 5}, word_embeddings);
|
||||
@ -499,7 +500,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_embed_layer_normalization_diff_seq_len
|
||||
5,
|
||||
};
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<int>(Shape{3, 8}, input_ids);
|
||||
test_case.add_input<int>(Shape{3, 8}, segment_ids);
|
||||
test_case.add_input<float>(Shape{10, 5}, word_embeddings);
|
||||
@ -602,7 +603,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_embed_layer_normalization_with_positio
|
||||
5,
|
||||
};
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<int>(Shape{3, 8}, input_ids);
|
||||
test_case.add_input<int>(Shape{3, 8}, segment_ids);
|
||||
test_case.add_input<float>(Shape{10, 5}, word_embeddings);
|
||||
@ -621,7 +622,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_attention) {
|
||||
const auto function = onnx_import::import_onnx_model(file_util::path_join(ov::test::utils::getExecutableDirectory(),
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/com.microsoft/attention.onnx"));
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
std::vector<float> input = {
|
||||
0.91475844f, 0.91523546f, 0.82536930f, 0.37491974f, 0.22384071f, 0.05941105f, 0.01902100f, 0.70131350f,
|
||||
@ -645,7 +646,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_attention_qkv_hidden_sizes) {
|
||||
onnx_import::import_onnx_model(file_util::path_join(ov::test::utils::getExecutableDirectory(),
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/com.microsoft/attention_qkv_hidden_sizes.onnx"));
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
std::vector<float> input = {
|
||||
0.56477863f, 0.60309958f, 0.35158035f, 0.03123519f, 0.81918180f, 0.76905495f, 0.47219241f, 0.72016627f,
|
||||
@ -673,7 +674,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_attention_unidirectional) {
|
||||
onnx_import::import_onnx_model(file_util::path_join(ov::test::utils::getExecutableDirectory(),
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/com.microsoft/attention_unidirectional.onnx"));
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
std::vector<float> input = {
|
||||
0.89578921f, 0.42421508f, 0.35630688f, 0.77461642f, 0.65753633f, 0.09723099f, 0.62597734f, 0.72117692f,
|
||||
@ -708,7 +709,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_attention_mask_index_1f) {
|
||||
onnx_import::import_onnx_model(file_util::path_join(ov::test::utils::getExecutableDirectory(),
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/com.microsoft/attention_mask_index_1.onnx"));
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
std::vector<float> input = {
|
||||
0.02841483f, 0.47845092f, 0.14633700f, 0.54597300f, 0.40160629f, 0.55281311f, 0.14931096f, 0.64483738f,
|
||||
@ -748,7 +749,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_attention_mask_index_2) {
|
||||
onnx_import::import_onnx_model(file_util::path_join(ov::test::utils::getExecutableDirectory(),
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/com.microsoft/attention_mask_index_2.onnx"));
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
std::vector<float> input = {
|
||||
0.75259578f, 0.81492645f, 0.46713001f, 0.29483622f, 0.06768602f, 0.95105755f, 0.32065326f, 0.52417183f,
|
||||
@ -790,7 +791,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_attention_mask_index_3) {
|
||||
onnx_import::import_onnx_model(file_util::path_join(ov::test::utils::getExecutableDirectory(),
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/com.microsoft/attention_mask_index_3.onnx"));
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
std::vector<float> input = {
|
||||
0.33093750f, 0.39181390f, 0.14586255f, 0.39709702f, 0.98086524f, 0.03891133f, 0.72234219f, 0.21966648f,
|
||||
@ -836,7 +837,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_attention_mask_index_4) {
|
||||
onnx_import::import_onnx_model(file_util::path_join(ov::test::utils::getExecutableDirectory(),
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/com.microsoft/attention_mask_index_4.onnx"));
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
std::vector<float> input = {
|
||||
0.23565151f, 0.58627969f, 0.75137484f, 0.68586946f, 0.62750375f, 0.13284931f, 0.13347220f, 0.36357051f,
|
||||
@ -875,7 +876,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_attention_past) {
|
||||
onnx_import::import_onnx_model(file_util::path_join(ov::test::utils::getExecutableDirectory(),
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/com.microsoft/attention_past.onnx"));
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
std::vector<float> input = {
|
||||
0.82966000f, 0.77751911f, 0.08977074f, 0.06076468f, 0.40659550f, 0.19995944f, 0.55544919f, 0.83971608f,
|
||||
@ -954,7 +955,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_attention_extra_add) {
|
||||
onnx_import::import_onnx_model(file_util::path_join(ov::test::utils::getExecutableDirectory(),
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/com.microsoft/attention_extra_add.onnx"));
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
std::vector<float> input = {
|
||||
0.14930259f, 0.11199699f, 0.81292826f, 0.08368169f, 0.05704883f, 0.41276145f, 0.38760167f, 0.00146112f,
|
||||
@ -1011,7 +1012,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_attention_dynamic_shapes) {
|
||||
onnx_import::import_onnx_model(file_util::path_join(ov::test::utils::getExecutableDirectory(),
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/com.microsoft/attention_dynamic_shapes.onnx"));
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
std::vector<float> input = {
|
||||
0.42226878f, 0.50984067f, 0.80440795f, 0.68040705f, 0.93614250f, 0.45104721f, 0.71767306f, 0.48596525f,
|
||||
@ -1112,7 +1113,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_fusedgemm_abc) {
|
||||
const auto function = onnx_import::import_onnx_model(file_util::path_join(ov::test::utils::getExecutableDirectory(),
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/com.microsoft/fusedgemm.onnx"));
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
std::vector<float> inputA = {
|
||||
0.760289272f,
|
||||
@ -1184,7 +1185,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_com_microsoft_fused_conv_hard_sigmoid) {
|
||||
onnx_import::import_onnx_model(file_util::path_join(ov::test::utils::getExecutableDirectory(),
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/com.microsoft/fused_conv_hard_sigmoid.onnx"));
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
const std::vector<float> X{1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f};
|
||||
const std::vector<float> W{0.125f, 0.125f, 0.125f, 0.125f, -0.125f, -0.125f, -0.125f, -0.125f};
|
||||
@ -1201,7 +1202,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_com_microsoft_fused_conv_relu) {
|
||||
onnx_import::import_onnx_model(file_util::path_join(ov::test::utils::getExecutableDirectory(),
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/com.microsoft/fused_conv_relu.onnx"));
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
const std::vector<float> X{1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f};
|
||||
const std::vector<float> W{1.0f, 1.0f, 1.0f, 1.0f, -1.0f, -1.0f, -1.0f, -1.0f};
|
||||
@ -1218,7 +1219,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_com_microsoft_fused_conv_tanh) {
|
||||
onnx_import::import_onnx_model(file_util::path_join(ov::test::utils::getExecutableDirectory(),
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/com.microsoft/fused_conv_tanh.onnx"));
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
const std::vector<float> X{1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f};
|
||||
const std::vector<float> W{1.0f, 1.0f, 1.0f, 1.0f, -1.0f, -2.0f, -1.0f, -2.0f};
|
||||
@ -1235,7 +1236,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_com_microsoft_fused_conv_sigmoid) {
|
||||
onnx_import::import_onnx_model(file_util::path_join(ov::test::utils::getExecutableDirectory(),
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/com.microsoft/fused_conv_sigmoid.onnx"));
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
const std::vector<float> X{1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f};
|
||||
const std::vector<float> W{1.0f, 1.0f, 5.0f, 1.0f, -1.0f, -2.0f, -5.0f, -2.0f};
|
||||
@ -1252,7 +1253,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_com_microsoft_fused_conv_clip) {
|
||||
onnx_import::import_onnx_model(file_util::path_join(ov::test::utils::getExecutableDirectory(),
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/com.microsoft/fused_conv_clip.onnx"));
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
const std::vector<float> X{1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f};
|
||||
const std::vector<float> W{1.0f, 1.0f, 5.0f, 1.0f, -1.0f, -2.0f, -5.0f, -2.0f};
|
||||
@ -1269,7 +1270,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_com_microsoft_fused_conv_leaky_relu) {
|
||||
onnx_import::import_onnx_model(file_util::path_join(ov::test::utils::getExecutableDirectory(),
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/com.microsoft/fused_conv_leaky_relu.onnx"));
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
const std::vector<float> X{1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f};
|
||||
const std::vector<float> W{1.0f, 1.0f, 1.0f, 1.0f, -1.0f, -1.0f, -1.0f, -1.0f};
|
||||
@ -1286,7 +1287,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_com_microsoft_fused_conv_relu_z_input) {
|
||||
onnx_import::import_onnx_model(file_util::path_join(ov::test::utils::getExecutableDirectory(),
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/com.microsoft/fused_conv_relu_z_input.onnx"));
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
const std::vector<float> X{1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f};
|
||||
const std::vector<float> W{1.0f, -1.0f, 1.0f, -1.0f, 1.0f, -1.0f, 1.0f, -1.0f};
|
||||
@ -1307,7 +1308,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_com_microsoft_trilu_lower) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/com.microsoft/trilu_lower.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
// clang-format off
|
||||
test_case.add_input<float>(Shape{4, 5},
|
||||
std::vector<float>{ 1, 2, 3, 4, 5,
|
||||
|
@ -3,25 +3,25 @@
|
||||
//
|
||||
|
||||
#include "common_test_utils/file_utils.hpp"
|
||||
#include "common_test_utils/test_case.hpp"
|
||||
#include "common_test_utils/test_control.hpp"
|
||||
#include "common_test_utils/test_tools.hpp"
|
||||
#include "common_test_utils/type_prop.hpp"
|
||||
#include "default_opset.hpp"
|
||||
#include "engines_util/test_case.hpp"
|
||||
#include "gtest/gtest.h"
|
||||
#include "ngraph/file_util.hpp"
|
||||
#include "ngraph/type.hpp"
|
||||
#include "ngraph/type/element_type.hpp"
|
||||
#include "onnx_import/onnx.hpp"
|
||||
#include "onnx_utils.hpp"
|
||||
|
||||
using namespace ngraph;
|
||||
using namespace ngraph::onnx_import;
|
||||
using namespace ngraph::test;
|
||||
|
||||
OPENVINO_SUPPRESS_DEPRECATED_START
|
||||
|
||||
static std::string s_manifest = "${MANIFEST}";
|
||||
static std::string s_device = test::backend_name_to_device("${BACKEND_NAME}");
|
||||
static std::string s_device = backend_name_to_device("${BACKEND_NAME}");
|
||||
|
||||
// ~~~~~~~~TERMINATION CONDITION/TRIP COUNT COMBINATIONS TESTS:~~~~~~~~
|
||||
|
||||
@ -51,7 +51,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_controlflow_loop_2d_add) {
|
||||
EXPECT_TRUE(function->get_output_partial_shape(1).is_static());
|
||||
EXPECT_EQ(function->get_output_shape(1), (Shape{3, 1, 2}));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
// a_init
|
||||
test_case.add_input<float>({0.f, 0.f});
|
||||
|
||||
@ -71,7 +71,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_controlflow_loop_2d_no_identity_termination_
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/controlflow/loop_2d_add_no_identity_termination_cond.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
// termination condition
|
||||
test_case.add_input<bool>({true});
|
||||
// a_init
|
||||
@ -88,7 +88,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_controlflow_loop_2d_trip_count_max_int) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/controlflow/loop_2d_add_trip_count_max_int.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
// termination condition
|
||||
test_case.add_input<bool>({true});
|
||||
// a_init
|
||||
@ -105,7 +105,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_controlflow_loop_2d_no_identity_termination_
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/controlflow/loop_2d_add_no_identity_termination_cond_static_shapes.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
// termination condition
|
||||
test_case.add_input<bool>({true});
|
||||
// a_init
|
||||
@ -123,7 +123,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_controlflow_loop_2d_no_identity_termination_
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/controlflow/loop_2d_add_no_identity_termination_cond_false.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
// a_init
|
||||
test_case.add_input<float>({3.f, 4.f});
|
||||
|
||||
@ -143,7 +143,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_controlflow_loop_2d_const_no_identity_termin
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/controlflow/loop_2d_add_const_no_identity_termination_cond.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
// a_init
|
||||
test_case.add_input<float>({0.f, 0.f});
|
||||
|
||||
@ -158,7 +158,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_controlflow_loop_2d_const_no_identity_termin
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/controlflow/loop_2d_add_const_no_identity_termination_cond_static_shapes.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
// a_init
|
||||
test_case.add_input<float>({0.f, 0.f});
|
||||
|
||||
@ -178,7 +178,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_controlflow_loop_2d_both_cond_and_trip_count
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/controlflow/loop_2d_add_cond_and_trip_count_as_inputs.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
// trip count
|
||||
test_case.add_input<int64_t>({10});
|
||||
|
||||
@ -199,7 +199,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_controlflow_loop_2d_both_cond_and_trip_count
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/controlflow/loop_2d_add_cond_and_trip_count_as_inputs_static_shapes.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
// trip count
|
||||
test_case.add_input<int64_t>({10});
|
||||
|
||||
@ -221,7 +221,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_controlflow_loop_add_initializer_from_parent
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/controlflow/loop_2d_add_initializer_from_parent_scope.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
// a_init
|
||||
test_case.add_input<float>({0.f, 0.f});
|
||||
@ -237,7 +237,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_controlflow_loop_add_node_from_parent_scope)
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/controlflow/loop_2d_add_node_from_parent_scope.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
// a_init
|
||||
test_case.add_input<float>({0.f, 0.f});
|
||||
|
||||
@ -252,7 +252,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_controlflow_loop_add_node_from_parent_scope_
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/controlflow/loop_add_node_from_parent_scope_used_in_parent_and_in_body.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
// a_init
|
||||
test_case.add_input<float>({0.f, 0.f});
|
||||
// parent_input
|
||||
@ -285,7 +285,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_controlflow_loop_add_value_the_same_node_fro
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/controlflow/loop_2d_add_the_same_name.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
// a_init
|
||||
test_case.add_input<float>({0.f, 0.f});
|
||||
|
||||
@ -300,7 +300,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_controlflow_loop_add_input_from_parent_graph
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/controlflow/loop_2d_add_input_from_parent_graph.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
// a_init
|
||||
test_case.add_input<float>({0.f, 0.f});
|
||||
// b input
|
||||
@ -337,7 +337,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_controlflow_loop_scalars) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/controlflow/loop_scalars_add.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
// a_init
|
||||
test_case.add_input<float>({0.f});
|
||||
|
||||
@ -352,7 +352,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_controlflow_loop_2d_add_const_cond) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/controlflow/loop_2d_add_const_cond.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
// a_init
|
||||
test_case.add_input<float>({0.f, 0.f});
|
||||
|
||||
@ -367,7 +367,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_controlflow_loop_2d_trip_count_dynamic) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/controlflow/loop_2d_add_trip_count_dynamic.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
// trip count
|
||||
test_case.add_input<int64_t>({3});
|
||||
// a_init
|
||||
@ -385,7 +385,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_controlflow_loop_2d_infer_types) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/controlflow/onnx_controlflow_loop_2d_infer_types.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
// trip count
|
||||
test_case.add_input<int64_t>({10});
|
||||
|
||||
@ -405,7 +405,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_controlflow_loop_add_node_from_parent_scope_
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/controlflow/loop_add_node_from_parent_scope_infer_types.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
// a_init
|
||||
test_case.add_input<float>({0.f, 0.f});
|
||||
// parent_input
|
||||
@ -425,7 +425,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_controlflow_loop_concat_values) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/controlflow/loop_concat_values.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
// trip_count
|
||||
test_case.add_input<int64_t>({5});
|
||||
// init condition
|
||||
@ -468,7 +468,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_controlflow_loop_infinite) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/controlflow/loop_infinite.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
// trip_count
|
||||
test_case.add_input<int64_t>({std::numeric_limits<int64_t>::max()});
|
||||
// init condition
|
||||
@ -491,7 +491,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_controlflow_loop_no_variadic_inputs_and_outp
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/controlflow/loop_no_variadic_inputs_and_outputs.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
// trip_count
|
||||
test_case.add_input<int64_t>({1});
|
||||
// init condition
|
||||
@ -507,7 +507,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_controlflow_loop_power) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/controlflow/loop_pow.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
// trip_count
|
||||
test_case.add_input<int64_t>({5});
|
||||
// pow init
|
||||
@ -533,7 +533,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_if_branches_with_same_inputs) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/controlflow/if_branches_with_same_inputs.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
std::vector<float> x(40, 2);
|
||||
std::vector<float> y(40);
|
||||
std::iota(y.begin(), y.end(), -20.f);
|
||||
@ -573,7 +573,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_if_branches_with_different_inputs) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/controlflow/if_branches_with_different_inputs.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
std::vector<float> x(40, 2);
|
||||
std::vector<float> y(40);
|
||||
std::iota(y.begin(), y.end(), -20.f);
|
||||
@ -613,7 +613,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_if_branches_without_inputs) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/controlflow/if_branches_without_inputs.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
// condition
|
||||
test_case.add_input<bool>({true});
|
||||
@ -642,7 +642,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_if_inside_if) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/controlflow/if_inside_if.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
// case when condition == true and any(x > y)
|
||||
// expected value == x * y
|
||||
@ -698,7 +698,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_if_branches_with_multiple_outputs) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/controlflow/if_branches_with_multiple_outputs.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
// case when condition == true so split is along axis 0
|
||||
std::vector<float> x(36);
|
||||
@ -738,7 +738,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_if_inside_loop) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/controlflow/if_inside_loop.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
// a_init
|
||||
test_case.add_input<float>({0.f, 0.f});
|
||||
|
||||
@ -764,7 +764,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_if_with_only_indentity_in_else_branch) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/controlflow/if_with_only_indentity_in_else_branch.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
std::vector<float> x(shape_size(Shape{1, 5, 2, 2}));
|
||||
std::iota(x.begin(), x.end(), 0.f);
|
||||
@ -795,7 +795,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_if_inside_if_inside_loop) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/controlflow/if_inside_if_inside_loop.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
// out_init
|
||||
test_case.add_input<float>({1.f});
|
||||
|
||||
@ -817,7 +817,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_if_dynamic_inputs) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/controlflow/if_dynamic_inputs.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
std::vector<float> x(40, 2);
|
||||
std::vector<float> y(40);
|
||||
std::iota(y.begin(), y.end(), -20.f);
|
||||
|
@ -16,19 +16,20 @@
|
||||
#include "common_test_utils/all_close.hpp"
|
||||
#include "common_test_utils/file_utils.hpp"
|
||||
#include "common_test_utils/ndarray.hpp"
|
||||
#include "common_test_utils/test_case.hpp"
|
||||
#include "common_test_utils/test_control.hpp"
|
||||
#include "common_test_utils/test_tools.hpp"
|
||||
#include "engines_util/test_case.hpp"
|
||||
#include "gtest/gtest.h"
|
||||
#include "ngraph/ngraph.hpp"
|
||||
#include "onnx_import/onnx.hpp"
|
||||
#include "onnx_utils.hpp"
|
||||
|
||||
using namespace ngraph;
|
||||
|
||||
OPENVINO_SUPPRESS_DEPRECATED_START
|
||||
|
||||
static std::string s_manifest = "${MANIFEST}";
|
||||
static std::string s_device = test::backend_name_to_device("${BACKEND_NAME}");
|
||||
static std::string s_device = backend_name_to_device("${BACKEND_NAME}");
|
||||
|
||||
using Inputs = std::vector<std::vector<float>>;
|
||||
using Outputs = std::vector<std::vector<float>>;
|
||||
@ -59,7 +60,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_conv2d_strides_padding) {
|
||||
{{{{12.f, 27.f, 24.f}, {63.f, 108.f, 81.f}, {123.f, 198.f, 141.f}, {112.f, 177.f, 124.f}}}})
|
||||
.get_vector();
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_multiple_inputs(inputs);
|
||||
test_case.add_expected_output(expected_output);
|
||||
test_case.run();
|
||||
@ -88,7 +89,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_conv2d_strides_no_padding) {
|
||||
// (1, 1, 3, 2)
|
||||
auto expected_output = test::NDArray<float, 4>({{{{54.f, 72.f}, {144.f, 162.f}, {234.f, 252.f}}}}).get_vector();
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_multiple_inputs(inputs);
|
||||
test_case.add_expected_output(expected_output);
|
||||
test_case.run();
|
||||
@ -119,7 +120,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_conv2d_strides_assymetric_padding) {
|
||||
auto expected_output =
|
||||
test::NDArray<float, 4>({{{{21.f, 33.f}, {99.f, 117.f}, {189.f, 207.f}, {171.f, 183.f}}}}).get_vector();
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_multiple_inputs(inputs);
|
||||
test_case.add_expected_output(expected_output);
|
||||
test_case.run();
|
||||
@ -159,7 +160,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_conv2d_dilation_assymetric_pads_stride
|
||||
{{{-0.04396762326359749f, 0.10081233829259872f}}, {{-0.10154513269662857f, -0.13448859751224518f}}}})
|
||||
.get_vector();
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_multiple_inputs(inputs);
|
||||
test_case.add_expected_output(expected_output);
|
||||
test_case.run();
|
||||
@ -263,7 +264,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_conv3d_bias) {
|
||||
-0.39770257472991943f, -0.45317384600639343f, -0.5598302483558655f, -0.2542789578437805f,
|
||||
-0.5359901785850525f, -0.48090484738349915f, -0.38603779673576355f, -0.4991581439971924f};
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_multiple_inputs(inputs);
|
||||
test_case.add_expected_output(expected_output);
|
||||
test_case.run();
|
||||
@ -283,7 +284,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_conv_transpose_w_groups) {
|
||||
|
||||
std::vector<float> expected_output{28.f, 34.f, 252.f, 274.f, 732.f, 770.f, 1468.f, 1522.f};
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_multiple_inputs(inputs);
|
||||
test_case.add_expected_output(expected_output);
|
||||
test_case.run();
|
||||
@ -304,7 +305,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_average_pool_2d) {
|
||||
// (1, 1, 2, 2)
|
||||
auto expected_output = test::NDArray<float, 4>({{{{2.5f, 4.5f}, {10.5f, 12.5f}}}}).get_vector();
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_multiple_inputs(inputs);
|
||||
test_case.add_expected_output(expected_output);
|
||||
test_case.run();
|
||||
@ -327,7 +328,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_average_pool_2d_pads) {
|
||||
auto expected_output =
|
||||
test::NDArray<float, 4>({{{{0.f, 1.5f, 3.f}, {6.f, 7.5f, 9.f}, {12.f, 13.5f, 15.f}}}}).get_vector();
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_multiple_inputs(inputs);
|
||||
test_case.add_expected_output(expected_output);
|
||||
test_case.run();
|
||||
@ -338,7 +339,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_average_pool_empty_auto_pad) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/average_pool_empty_auto_pad.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f});
|
||||
test_case.add_expected_output<float>(
|
||||
Shape{1, 1, 3, 3},
|
||||
@ -377,7 +378,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_max_pool_2d_pads) {
|
||||
auto expected_output =
|
||||
test::NDArray<float, 4>({{{{0.f, 2.f, 3.f}, {8.f, 10.f, 11.f}, {12.f, 14.f, 15.f}}}}).get_vector();
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_multiple_inputs(inputs);
|
||||
test_case.add_expected_output(expected_output);
|
||||
test_case.run();
|
||||
@ -391,7 +392,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_global_lp_pool_p0) {
|
||||
|
||||
std::vector<std::int64_t> expected_output{6, 8};
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input(input);
|
||||
test_case.add_expected_output(expected_output);
|
||||
test_case.run();
|
||||
@ -406,7 +407,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_global_lp_pool_p1) {
|
||||
|
||||
std::vector<float> expected_output{66.f, 210.f};
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_multiple_inputs(inputs);
|
||||
test_case.add_expected_output(expected_output);
|
||||
test_case.run();
|
||||
@ -421,7 +422,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_global_lp_pool_p2) {
|
||||
|
||||
std::vector<float> expected_output{22.494444f, 61.789967f};
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_multiple_inputs(inputs);
|
||||
test_case.add_expected_output(expected_output);
|
||||
test_case.run();
|
||||
@ -436,7 +437,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_global_lp_pool_p3) {
|
||||
|
||||
std::vector<float> expected_output{16.331620904278438f, 41.56697946707537f};
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_multiple_inputs(inputs);
|
||||
test_case.add_expected_output(expected_output);
|
||||
test_case.run();
|
||||
@ -447,7 +448,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_convtranspose_output_shape) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/convtranspose_output_shape.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
test_case.add_input_from_file<float>(file_util::path_join(ov::test::utils::getExecutableDirectory(),
|
||||
SERIALIZED_ZOO,
|
||||
@ -469,7 +470,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_convtranspose_output_shape_auto_pads_s
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/convtranspose_output_shape_auto_pads_same_upper.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
test_case.add_input<float>({0.f, 0.25f, 0.5f, 0.75f, 1.f, 1.25f, 1.5f, 1.75f, 2.f, 2.25f, 2.5f, 2.75f});
|
||||
test_case.add_input<float>({0.f, 0.25f, 0.5f, 0.75f, 1.f, 1.25f, 1.5f, 1.75f, 2.f, 2.25f, 2.5f, 2.75f,
|
||||
@ -496,7 +497,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_convtranspose_output_shape_auto_pads_s
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/convtranspose_output_shape_auto_pads_same_lower.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
test_case.add_input<float>({0.f, 0.25f, 0.5f, 0.75f, 1.f, 1.25f, 1.5f, 1.75f, 2.f, 2.25f, 2.5f, 2.75f});
|
||||
test_case.add_input<float>({0.f, 0.25f, 0.5f, 0.75f, 1.f, 1.25f, 1.5f, 1.75f, 2.f, 2.25f, 2.5f, 2.75f,
|
||||
@ -522,7 +523,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_convtranspose_groups_w_pads) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/convtranspose_groups_w_pads.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
test_case.add_input<float>({
|
||||
0.f,
|
||||
@ -575,7 +576,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_convtranspose_groups_pads_bias) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/convtranspose_groups_pads_bias.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
test_case.add_input<float>({0.f,
|
||||
0.25f,
|
||||
|
@ -16,19 +16,20 @@
|
||||
#include "common_test_utils/all_close.hpp"
|
||||
#include "common_test_utils/file_utils.hpp"
|
||||
#include "common_test_utils/ndarray.hpp"
|
||||
#include "common_test_utils/test_case.hpp"
|
||||
#include "common_test_utils/test_control.hpp"
|
||||
#include "common_test_utils/test_tools.hpp"
|
||||
#include "engines_util/test_case.hpp"
|
||||
#include "gtest/gtest.h"
|
||||
#include "ngraph/ngraph.hpp"
|
||||
#include "onnx_import/onnx.hpp"
|
||||
#include "onnx_utils.hpp"
|
||||
|
||||
using namespace ngraph;
|
||||
|
||||
OPENVINO_SUPPRESS_DEPRECATED_START
|
||||
|
||||
static std::string s_manifest = "${MANIFEST}";
|
||||
static std::string s_device = test::backend_name_to_device("${BACKEND_NAME}");
|
||||
static std::string s_device = backend_name_to_device("${BACKEND_NAME}");
|
||||
|
||||
OPENVINO_TEST(${BACKEND_NAME}, onnx_model_affine) {
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
@ -38,7 +39,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_affine) {
|
||||
auto input = test::NDArray<float, 2>{{{0.f, 1.f, 2.f}}}.get_vector();
|
||||
auto expected_output = test::NDArray<float, 2>{{{50.f, 50.5f, 51.f}}}.get_vector();
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input(Shape{1, 3}, input);
|
||||
test_case.add_expected_output(Shape{1, 3}, expected_output);
|
||||
test_case.run();
|
||||
@ -58,7 +59,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_crop) {
|
||||
// output shape (1, 1, 2, 2)
|
||||
auto expected_output = test::NDArray<float, 4>{{{{24.f, 25.f}, {28.f, 29.f}}}}.get_vector();
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input(Shape{1, 1, 4, 4}, input);
|
||||
test_case.add_expected_output(Shape{1, 1, 2, 2}, expected_output);
|
||||
test_case.run();
|
||||
@ -78,7 +79,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_crop_with_scale) {
|
||||
// output shape (1, 1, 2, 3)
|
||||
auto expected_output = test::NDArray<float, 4>{{{{24.f, 25.f, 26.f}, {28.f, 29.f, 30.f}}}}.get_vector();
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input(Shape{1, 1, 4, 4}, input);
|
||||
test_case.add_expected_output(Shape{1, 1, 2, 3}, expected_output);
|
||||
test_case.run();
|
||||
|
@ -17,22 +17,22 @@
|
||||
|
||||
#include "common_test_utils/file_utils.hpp"
|
||||
#include "default_opset.hpp"
|
||||
#include "engines_util/test_case.hpp"
|
||||
#include "common_test_utils/test_case.hpp"
|
||||
#include "gtest/gtest.h"
|
||||
#include "ngraph/file_util.hpp"
|
||||
#include "onnx_import/onnx.hpp"
|
||||
#include "common_test_utils/test_control.hpp"
|
||||
#include "common_test_utils/test_tools.hpp"
|
||||
#include "common_test_utils/type_prop.hpp"
|
||||
#include "onnx_utils.hpp"
|
||||
|
||||
using namespace ngraph;
|
||||
using namespace ngraph::onnx_import;
|
||||
using namespace ngraph::test;
|
||||
|
||||
OPENVINO_SUPPRESS_DEPRECATED_START
|
||||
|
||||
static std::string s_manifest = "${MANIFEST}";
|
||||
static std::string s_device = test::backend_name_to_device("${BACKEND_NAME}");
|
||||
static std::string s_device = backend_name_to_device("${BACKEND_NAME}");
|
||||
|
||||
OPENVINO_TEST(${BACKEND_NAME}, onnx_dyn_shapes_onnx_dynamic_dims_to_ngraph_dynamic_dims) {
|
||||
// the model represents a linear function A * x + B
|
||||
@ -75,7 +75,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_dyn_shapes_ab_plus_c_inference) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dynamic_shapes/ab_plus_c.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
struct ExpectedValuesGenerator {
|
||||
int64_t i = 1;
|
||||
@ -154,7 +154,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_dyn_shapes_dynamic_rank_input_inference) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dynamic_shapes/a_plus_b_dyn_rank.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
const size_t RANKS_TO_TEST = 3;
|
||||
const int64_t SCALAR_INPUT_VAL = 5;
|
||||
@ -182,7 +182,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_dyn_shapes_model_acosh_1_3) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dynamic_shapes/acosh_dyn_shape.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>(Shape{1, 3}, {1.0f, 2.5f, 4.3f});
|
||||
test_case.add_expected_output<float>(Shape{1, 3}, {0.0f, 1.5667993f, 2.1379586f});
|
||||
|
||||
@ -194,7 +194,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_dyn_shapes_model_acosh_3_2) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dynamic_shapes/acosh_dyn_shape.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>(Shape{3, 2}, {1.0f, 2.5f, 4.3f, 1.0f, 2.5f, 4.3f});
|
||||
test_case.add_expected_output<float>(Shape{3, 2}, {0.0f, 1.5667993f, 2.1379586f, 0.0f, 1.5667993f, 2.1379586f});
|
||||
|
||||
@ -206,7 +206,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_dyn_shapes_model_asinh_1_3) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dynamic_shapes/asinh_dyn_shape.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>(Shape{1, 3}, {-1.5f, 0.0f, 1.5f});
|
||||
test_case.add_expected_output<float>(Shape{1, 3}, {-1.1947632f, 0.0f, 1.1947632f});
|
||||
|
||||
@ -218,7 +218,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_dyn_shapes_model_asinh_3_2) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dynamic_shapes/asinh_dyn_shape.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>(Shape{3, 2}, {-1.5f, 0.0f, 1.5f, -1.5f, 0.0f, 1.5f});
|
||||
test_case.add_expected_output<float>(Shape{3, 2}, {-1.1947632f, 0.0f, 1.1947632f, -1.1947632f, 0.0f, 1.1947632f});
|
||||
|
||||
@ -230,7 +230,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_dyn_shapes_model_atanh_1_3) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dynamic_shapes/atanh_dyn_shape.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>(Shape{1, 3}, {-0.9f, 0.0f, 0.9f});
|
||||
test_case.add_expected_output<float>(Shape{1, 3}, {-1.47221948f, 0.0f, 1.47221948f});
|
||||
|
||||
@ -242,7 +242,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_dyn_shapes_model_atanh_3_2) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dynamic_shapes/atanh_dyn_shape.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>(Shape{3, 2}, {-0.9f, 0.0f, 0.9f, -0.9f, 0.0f, 0.9f});
|
||||
test_case.add_expected_output<float>(Shape{3, 2},
|
||||
{-1.47221948f, 0.0f, 1.47221948f, -1.47221948f, 0.0f, 1.47221948f});
|
||||
@ -256,7 +256,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_dyn_shapes_model_conv_with_dynamic_batch) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dynamic_shapes/conv_with_dynamic_batch.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
const auto data_shape = Shape{1, 3, 7, 7};
|
||||
const auto filters_shape = Shape{10, 3, 2, 2};
|
||||
@ -280,7 +280,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_dyn_shapes_model_conv_with_dynamic_bias) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dynamic_shapes/conv_with_dynamic_bias.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
const auto data_shape = Shape{1, 3, 7, 7};
|
||||
const auto filters_shape = Shape{10, 3, 2, 2};
|
||||
@ -304,7 +304,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_dyn_shapes_avg_pool_dyn_shape) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dynamic_shapes/average_pool_2d_dyn.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
const Shape shape{1, 1, 4, 4};
|
||||
const auto elems_in_tensor = shape_size(shape);
|
||||
@ -325,7 +325,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_dyn_shapes_max_pool_dyn_shape) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dynamic_shapes/max_pool_2d_dyn.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
const Shape shape{1, 1, 4, 4};
|
||||
const auto elems_in_tensor = shape_size(shape);
|
||||
@ -346,7 +346,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_dyn_shapes_max_pool_with_indices_output) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dynamic_shapes/max_pool_with_indices_output.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
const Shape shape{1, 1, 5, 5};
|
||||
std::vector<float> input_values(shape_size(shape));
|
||||
@ -370,7 +370,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_dyn_shapes_global_avg_pool_dyn_shape) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dynamic_shapes/global_average_pool_dyn.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
const Shape shape{1, 3, 5, 5};
|
||||
const auto elems_in_tensor = shape_size(shape);
|
||||
@ -391,7 +391,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_dyn_shapes_global_max_pool_dyn_shape) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dynamic_shapes/global_max_pool_dyn.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
const Shape shape{1, 3, 5, 5};
|
||||
const auto elems_in_tensor = shape_size(shape);
|
||||
@ -411,7 +411,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_dyn_shapes_arg_max_dyn_shape) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dynamic_shapes/argmax_dyn.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
const Shape shape{3, 2, 2};
|
||||
const auto elems_in_tensor = shape_size(shape);
|
||||
@ -432,7 +432,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_dyn_shapes_arg_min_no_keep_dims_dyn_shape) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dynamic_shapes/argmin_no_keep_dims_dyn.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
const Shape shape{3, 2, 2};
|
||||
const auto elems_in_tensor = shape_size(shape);
|
||||
@ -455,7 +455,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_constant_of_shape_float_zeros) {
|
||||
|
||||
std::vector<float> expected_values(24, 0);
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
test_case.add_input<int64_t>(Shape{3}, std::vector<int64_t>{2, 3, 4});
|
||||
test_case.add_expected_output<float>(Shape{2, 3, 4}, expected_values);
|
||||
@ -471,7 +471,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_constant_of_shape_int_ones) {
|
||||
|
||||
std::vector<int32_t> expected_values(6, 1);
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
test_case.add_input<int64_t>(Shape{2}, std::vector<int64_t>{2, 3});
|
||||
test_case.add_expected_output<int32_t>(Shape{2, 3}, expected_values);
|
||||
@ -484,7 +484,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_dyn_shapes_expand_1_dyn_shape) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dynamic_shapes/expand_dyn.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
test_case.add_input<float>(Shape{3, 1}, std::vector<float>{1.f, 2.f, 3.f});
|
||||
test_case.add_input<int64_t>(Shape{3}, std::vector<int64_t>{2, 1, 6});
|
||||
@ -502,7 +502,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_dyn_shapes_expand_2_dyn_shape) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dynamic_shapes/expand_dyn.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
test_case.add_input<float>(Shape{3, 1}, std::vector<float>{1.f, 2.f, 3.f});
|
||||
test_case.add_input<int64_t>(Shape{3}, std::vector<int64_t>{2, 3, 4});
|
||||
@ -519,7 +519,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_dyn_shapes_expand_3_dyn_shape) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dynamic_shapes/expand_dyn.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
test_case.add_input<float>(Shape{2, 1}, std::vector<float>{4.f, 5.f});
|
||||
test_case.add_input<int64_t>(Shape{2}, std::vector<int64_t>{2, 4});
|
||||
@ -535,7 +535,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_dyn_shapes_expand_4_dyn_shape) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dynamic_shapes/expand_dyn.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
test_case.add_input<float>(Shape{1, 3, 1}, std::vector<float>{7.f, 8.f, 9.f});
|
||||
test_case.add_input<int64_t>(Shape{2}, std::vector<int64_t>{3, 1});
|
||||
@ -551,7 +551,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_dyn_shapes_expand_5_dyn_shape) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dynamic_shapes/expand_dyn.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
test_case.add_input<float>(Shape{1, 4, 1}, std::vector<float>{7.f, 8.f, 9.f, 10.f});
|
||||
test_case.add_input<int64_t>(Shape{2}, std::vector<int64_t>{1, 4});
|
||||
@ -568,7 +568,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_dyn_shapes_expand_6_dyn_shape) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dynamic_shapes/expand_dyn.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
test_case.add_input<float>(Shape{1, 3, 1}, std::vector<float>{7.f, 8.f, 9.f});
|
||||
test_case.add_input<int64_t>(Shape{3}, std::vector<int64_t>{3, 1, 3});
|
||||
@ -586,7 +586,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_dyn_shapes_expand_uint16_dyn_shape) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dynamic_shapes/expand_uint16_dyn.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
test_case.add_input<uint16_t>(Shape{1, 2, 1}, std::vector<uint16_t>{1, 2});
|
||||
test_case.add_input<int64_t>(Shape{4}, std::vector<int64_t>{2, 2, 1, 2});
|
||||
@ -601,7 +601,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_dyn_shapes_model_tile) {
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(ov::test::utils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/tile.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<std::int16_t>({0, 1, 2, 3, 4, 5}); // input
|
||||
test_case.add_input<std::int64_t>({2, 1}); // repeats
|
||||
test_case.add_expected_output<std::int16_t>(Shape{4, 3}, {0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5});
|
||||
@ -612,7 +612,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_dyn_shapes_model_tile_static) {
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(ov::test::utils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/tile_static.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<std::int16_t>({0, 1, 2, 3, 4, 5}); // input
|
||||
test_case.add_expected_output<std::int16_t>(Shape{4, 6}, {0, 1, 2, 0, 1, 2, 3, 4, 5, 3, 4, 5,
|
||||
0, 1, 2, 0, 1, 2, 3, 4, 5, 3, 4, 5});
|
||||
@ -624,7 +624,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_dyn_shapes_model_convtranspose_dyn_data) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/convtranspose_dyn_data.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(ct_fn);
|
||||
auto test_case = ov::test::TestCase(ct_fn);
|
||||
|
||||
// data
|
||||
test_case.add_input<float>(
|
||||
@ -666,7 +666,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_dyn_shapes_model_convtranspose_dyn_filters)
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/convtranspose_dyn_filters.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(ct_fn);
|
||||
auto test_case = ov::test::TestCase(ct_fn);
|
||||
|
||||
// data
|
||||
test_case.add_input<float>(
|
||||
@ -707,7 +707,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_dyn_shapes_transpose) {
|
||||
const auto function = onnx_import::import_onnx_model(file_util::path_join(ov::test::utils::getExecutableDirectory(),
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dynamic_shapes/transpose.onnx"));
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
Shape shape{2, 2, 4, 3};
|
||||
const auto elems_in_tensor = shape_size(shape);
|
||||
@ -744,7 +744,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_dyn_shapes_flatten_axis_0) {
|
||||
onnx_import::import_onnx_model(file_util::path_join(ov::test::utils::getExecutableDirectory(),
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dynamic_shapes/flatten_dyn_shape_axis0.onnx"));
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
const size_t RANKS_TO_TEST = 4;
|
||||
const size_t AXIS = 0;
|
||||
@ -771,7 +771,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_dyn_shapes_flatten_axis) {
|
||||
onnx_import::import_onnx_model(file_util::path_join(ov::test::utils::getExecutableDirectory(),
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dynamic_shapes/flatten_dyn_shape_axis.onnx"));
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
const size_t RANKS_TO_TEST = 4;
|
||||
const size_t AXIS = 3;
|
||||
@ -798,7 +798,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_dyn_shapes_flatten_neg_axis) {
|
||||
onnx_import::import_onnx_model(file_util::path_join(ov::test::utils::getExecutableDirectory(),
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dynamic_shapes/flatten_dyn_shape_neg_axis.onnx"));
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
const size_t RANKS_TO_TEST = 4;
|
||||
const int64_t AXIS = -3;
|
||||
@ -825,7 +825,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_dyn_shapes_model_flatten) {
|
||||
file_util::path_join(ov::test::utils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/flatten.onnx"));
|
||||
|
||||
std::vector<float> data{1, 2, 3, 4, 5, 6, 7, 8};
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>(Shape{1, 2, 2, 2}, data);
|
||||
test_case.add_expected_output<float>(Shape{1, 8}, data);
|
||||
|
||||
@ -837,7 +837,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_dyn_shapes_model_global_lp_dynamic_hw) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/global_lp_pool_dynamic_hw.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<int64_t>(Shape{1, 2, 3, 4},
|
||||
{1, 0, -4, 0, 2, 1, -6, 1, 0, 0, 0, 0, -7, 1, -1, 0, -1, 8, 0, 10, 9, 0, 0, 5});
|
||||
test_case.add_expected_output(Shape{1, 2, 1, 1}, std::vector<int64_t>{6, 8});
|
||||
@ -850,7 +850,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_dyn_shapes_slice_10_2d_input) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dynamic_shapes/slice_2d_input.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>(std::vector<float>{1, 2, 3, 4, 5, 6, 7, 8});
|
||||
test_case.add_input<int64_t>({1, 0});
|
||||
test_case.add_input<int64_t>({2, 3});
|
||||
@ -865,7 +865,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_dyn_shapes_slice_10_default_steps) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dynamic_shapes/slice_default_steps.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>({1, 2, 3, 4, 5, 6, 7, 8});
|
||||
test_case.add_input<int64_t>({1, 0});
|
||||
test_case.add_input<int64_t>({2, 3});
|
||||
@ -879,7 +879,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_dyn_shapes_slice_10_slice_2d_default_steps_d
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dynamic_shapes/slice_2d_default_steps_dyn_begin_end.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>({1, 2, 3, 4});
|
||||
test_case.add_input<int64_t>({2}, {1, 1});
|
||||
test_case.add_input<int64_t>({2}, {2, 2});
|
||||
@ -893,7 +893,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_dyn_shapes_slice_10_clamp_neg_ends) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dynamic_shapes/slice_default_steps.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>(std::vector<float>{1, 2, 3, 4, 5, 6, 7, 8});
|
||||
test_case.add_input<int64_t>({0, 1});
|
||||
test_case.add_input<int64_t>({-1, 1000});
|
||||
@ -906,7 +906,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_dyn_shapes_slice_10_3d_input) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dynamic_shapes/slice_3d_input.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
const Shape input_shape{3, 4, 1};
|
||||
std::vector<float> input_values(shape_size(input_shape));
|
||||
@ -925,7 +925,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_dyn_shapes_slice_10_3d_input_neg_axes) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dynamic_shapes/slice_3d_input_neg_axes.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
const Shape input_shape{3, 4, 1};
|
||||
std::vector<float> input_values(shape_size(input_shape));
|
||||
@ -944,7 +944,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_dyn_shapes_slice_10_3d_input_12_axes) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dynamic_shapes/slice_3d_input_12_axes.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
const Shape input_shape{4, 3, 2};
|
||||
std::vector<float> input_values(shape_size(input_shape));
|
||||
@ -962,7 +962,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_dyn_shapes_slice_10_3d_input_20_axes) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dynamic_shapes/slice_3d_input_20_axes.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
const Shape input_shape{4, 3, 2};
|
||||
std::vector<float> input_values(shape_size(input_shape));
|
||||
@ -981,7 +981,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_dyn_shapes_slice_10_4d_input_23_axes) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dynamic_shapes/slice_4d_input_23_axes.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
const Shape input_shape{2, 2, 2, 2};
|
||||
std::vector<float> input_values(shape_size(input_shape));
|
||||
@ -999,7 +999,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_dyn_shapes_slice_10_4d_input_0231_axes_ends_
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dynamic_shapes/slice_4d_input_0231_axes_ends_max.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
const Shape input_shape{2, 2, 2, 2};
|
||||
std::vector<float> input_values(shape_size(input_shape));
|
||||
@ -1020,7 +1020,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_dyn_shapes_slice_10_4d_input_2103_axes_ends_
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dynamic_shapes/slice_4d_input_2103_axes.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
const Shape input_shape{2, 2, 2, 5};
|
||||
std::vector<float> input_values(shape_size(input_shape));
|
||||
@ -1042,7 +1042,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_dyn_shapes_slice_10_4d_input_23_axes_21_step
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dynamic_shapes/slice_4d_input_23_axes_21_steps.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
const Shape input_shape{2, 2, 6, 2};
|
||||
std::vector<float> input_values(shape_size(input_shape));
|
||||
@ -1059,7 +1059,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_dyn_shapes_slice_10_default_axes) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dynamic_shapes/slice_default_axes.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
const Shape input_shape{4, 3, 2};
|
||||
std::vector<float> input_values(shape_size(input_shape));
|
||||
@ -1076,7 +1076,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_dyn_shapes_slice_10_the_same_output_same) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dynamic_shapes/slice_2d_the_same_out_shape.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>(std::vector<float>{1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f});
|
||||
test_case.add_input<float>(std::vector<float>{1.0f, 1.0f});
|
||||
test_case.add_expected_output<float>(Shape{3, 2}, {2.0f, 1.0f, 4.0f, 3.0f, 6.0f, 5.0f});
|
||||
@ -1087,7 +1087,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_dyn_model_hardmax) {
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(ov::test::utils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/hardmax.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>(
|
||||
{-2.02458119f, 0.00126542f, -0.58045743f, -0.75186814f, 0.9406899f, -0.513188f, 0.85887463f,
|
||||
1.61444086f, 0.23801147f, -0.26816885f, 0.6597208f, 1.43889519f, 0.28798895f, 1.44769952f,
|
||||
@ -1131,7 +1131,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_dyn_model_softmax_axis_2) {
|
||||
-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);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>(input);
|
||||
|
||||
test_case.add_expected_output<float>(
|
||||
@ -1155,7 +1155,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_range_positive_step) {
|
||||
const auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(ov::test::utils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/range.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
test_case.add_input<float>({1.f});
|
||||
test_case.add_input<float>({10.f});
|
||||
@ -1169,7 +1169,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_range_negative_step) {
|
||||
const auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(ov::test::utils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/range.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
test_case.add_input<float>({10.f});
|
||||
test_case.add_input<float>({1.f});
|
||||
@ -1189,7 +1189,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_instance_normalization_dyn_shape) {
|
||||
std::vector<float> data(shape_size(data_shape));
|
||||
std::iota(std::begin(data), std::end(data), 1.f);
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
test_case.add_input<float>(data_shape, data);
|
||||
test_case.add_input<float>(Shape{2}, std::vector<float>{2.134f, 3.256f});
|
||||
@ -1212,7 +1212,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_instance_normalization_dyn_shape2) {
|
||||
std::vector<float> data(shape_size(data_shape));
|
||||
std::iota(std::begin(data), std::end(data), 1.f);
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
test_case.add_input<float>(data_shape, data);
|
||||
test_case.add_input<float>(std::vector<float>{2.134f, 3.256f});
|
||||
@ -1235,7 +1235,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_instance_normalization_dyn_shape2) {
|
||||
// // mode: nearest
|
||||
//
|
||||
// Shape expected_output_shape{1, 1, 4, 6};
|
||||
// auto test_case = test::TestCase(function, s_device);
|
||||
// auto test_case = ov::test::TestCase(function, s_device);
|
||||
// test_case.add_input<float>({1.0, 2.0, 3.0, 4.0});
|
||||
// test_case.add_input<float>({1.0, 1.0, 2.0, 3.0});
|
||||
// test_case.add_expected_output<float>(
|
||||
@ -1250,7 +1250,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_dyn_shapes_slice_1_2d_input) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dynamic_shapes/slice_2d_input_opset1.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>(std::vector<float>{1, 2, 3, 4, 5, 6, 7, 8});
|
||||
test_case.add_expected_output<float>(Shape{1, 4}, {5, 6, 7, 8});
|
||||
test_case.run();
|
||||
@ -1262,7 +1262,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_dyn_shapes_slice_1_clamp_neg_ends) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dynamic_shapes/slice_2d_clamp_neg_ends_opset1.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>(std::vector<float>{1, 2, 3, 4, 5, 6, 7, 8});
|
||||
test_case.add_expected_output<float>(Shape{1, 3}, {2, 3, 4});
|
||||
test_case.run();
|
||||
@ -1274,7 +1274,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_dyn_shapes_slice_1_3d_input_21_axes_ends_max
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dynamic_shapes/slice_3d_input_21_axes_ends_max_opset1.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
const Shape input_shape{1, 2, 3, 4};
|
||||
std::vector<float> input_values(shape_size(input_shape));
|
||||
@ -1291,7 +1291,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_dyn_shapes_reduce_max_dynamic_input_rank_neg
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dynamic_shapes/reduce_max_dynamic_input_rank_negative_axis.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>(Shape{2, 4}, std::vector<float>{1, 2, 3, 4, 5, 6, 7, 8});
|
||||
test_case.add_expected_output<float>(Shape{2, 1}, {4, 8});
|
||||
test_case.run();
|
||||
@ -1302,7 +1302,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_size_dyn_op) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dynamic_shapes/size_op_dyn.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>(Shape{2, 3}, {1.0, 2.0, 3.0, 4.0, 5.0, 6.0});
|
||||
test_case.add_expected_output<int64_t>(Shape{}, {6});
|
||||
test_case.run();
|
||||
@ -1314,7 +1314,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_max_pool_dyn_rank_without_default_attr
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dynamic_shapes/max_pool_dyn_rank_without_default_attrs.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
Shape input_shape{1, 1, 4, 4};
|
||||
std::vector<float> input(shape_size(input_shape));
|
||||
@ -1336,7 +1336,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_depth_to_space_dynamic_input) {
|
||||
11.f, 18.f, 26.f, 19.f, 27.f, 4.f, 12.f, 5.f, 13.f, 20.f, 28.f,
|
||||
21.f, 29.f, 6.f, 14.f, 7.f, 15.f, 22.f, 30.f, 23.f, 31.f};
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input(Shape{1, 8, 2, 2}, input);
|
||||
test_case.add_expected_output(Shape{1, 2, 4, 4}, expected_output);
|
||||
test_case.run();
|
||||
@ -1355,7 +1355,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_space_to_depth_dynamic_input) {
|
||||
4.f, 6.f, 12.f, 14.f, 20.f, 22.f, 28.f, 30.f, 5.f, 7.f, 13.f, 15.f, 21.f, 23.f, 29.f, 31.f,
|
||||
};
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input(Shape{1, 2, 4, 4}, input);
|
||||
test_case.add_expected_output(Shape{1, 8, 2, 2}, expected_output);
|
||||
test_case.run();
|
||||
@ -1367,7 +1367,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_eye_like_dyn_shape) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dynamic_shapes/eye_like_dyn_shape.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>(Shape{3, 4}, {5.f, 5.f, 5.f, 5.f, 5.f, 5.f, 5.f, 5.f, 5.f, 5.f, 5.f, 5.f});
|
||||
test_case.add_expected_output<float>(Shape{3, 4}, {0.f, 0.f, 0.f, 0.f, 1.f, 0.f, 0.f, 0.f, 0.f, 1.f, 0.f, 0.f});
|
||||
|
||||
@ -1380,7 +1380,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_eye_like_dyn_rank) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dynamic_shapes/eye_like_dyn_rank.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>(Shape{3, 4}, {5.f, 5.f, 5.f, 5.f, 5.f, 5.f, 5.f, 5.f, 5.f, 5.f, 5.f, 5.f});
|
||||
test_case.add_expected_output<float>(Shape{3, 4}, {0.f, 0.f, 0.f, 0.f, 1.f, 0.f, 0.f, 0.f, 0.f, 1.f, 0.f, 0.f});
|
||||
|
||||
|
@ -24,7 +24,7 @@
|
||||
|
||||
#include "common_test_utils/file_utils.hpp"
|
||||
#include "default_opset.hpp"
|
||||
#include "engines_util/test_case.hpp"
|
||||
#include "common_test_utils/test_case.hpp"
|
||||
#include "gtest/gtest.h"
|
||||
#include "ngraph/ngraph.hpp"
|
||||
#include "ngraph/pass/constant_folding.hpp"
|
||||
@ -37,13 +37,14 @@
|
||||
#include "common_test_utils/test_control.hpp"
|
||||
#include "common_test_utils/test_tools.hpp"
|
||||
#include "common_test_utils/type_prop.hpp"
|
||||
#include "onnx_utils.hpp"
|
||||
|
||||
OPENVINO_SUPPRESS_DEPRECATED_START
|
||||
|
||||
using namespace ngraph;
|
||||
|
||||
static std::string s_manifest = "${MANIFEST}";
|
||||
static std::string s_device = test::backend_name_to_device("${BACKEND_NAME}");
|
||||
static std::string s_device = backend_name_to_device("${BACKEND_NAME}");
|
||||
|
||||
using Inputs = std::vector<std::vector<float>>;
|
||||
using Outputs = std::vector<std::vector<float>>;
|
||||
@ -51,7 +52,7 @@ using Outputs = std::vector<std::vector<float>>;
|
||||
OPENVINO_TEST(${BACKEND_NAME}, onnx_prior_box) {
|
||||
const auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(ov::test::utils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/prior_box.onnx"));
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
std::vector<float> A(3 * 2 * 2);
|
||||
std::vector<float> B(3 * 6 * 6);
|
||||
std::vector<float> output = {
|
||||
@ -75,7 +76,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_priorbox_clustered) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/priorbox_clustered.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
std::vector<float> A{15.0f};
|
||||
std::vector<float> B{10.0f};
|
||||
std::vector<float> output = {
|
||||
@ -94,7 +95,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_priorbox_clustered_most_attrs_default) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/priorbox_clustered_most_attrs_default.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
std::vector<float> A(1 * 1 * 2 * 1);
|
||||
std::iota(std::begin(A), std::end(A), 0.0f);
|
||||
std::vector<float> B(1 * 1 * 3 * 3);
|
||||
@ -152,7 +153,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_priorbox_clustered_second_input_bad_shape) {
|
||||
OPENVINO_TEST(${BACKEND_NAME}, onnx_detection_output) {
|
||||
const auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(ov::test::utils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/detection_output.onnx"));
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
auto gen_vector = [](size_t size, float min, float max) -> std::vector<float> {
|
||||
float step = (max - min) / size;
|
||||
@ -184,7 +185,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_detection_output) {
|
||||
OPENVINO_TEST(${BACKEND_NAME}, onnx_group_norm) {
|
||||
const auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(ov::test::utils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/group_norm.onnx"));
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
Shape shape{2, 8, 2, 2};
|
||||
const auto size = shape_size(shape);
|
||||
std::vector<float> data(size);
|
||||
@ -210,7 +211,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_group_norm_squeeze_bias_and_scale) {
|
||||
onnx_import::import_onnx_model(file_util::path_join(ov::test::utils::getExecutableDirectory(),
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/group_norm_4D_bias_and_scale.onnx"));
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
Shape shape{2, 8, 2, 2};
|
||||
const auto size = shape_size(shape);
|
||||
std::vector<float> data(size);
|
||||
@ -234,7 +235,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_group_norm_squeeze_bias_and_scale) {
|
||||
OPENVINO_TEST(${BACKEND_NAME}, onnx_group_norm_5d) {
|
||||
const auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(ov::test::utils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/group_norm_5d.onnx"));
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
Shape shape{2, 8, 1, 2, 1};
|
||||
const auto size = shape_size(shape);
|
||||
std::vector<float> data(size);
|
||||
@ -255,7 +256,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_group_norm_5d) {
|
||||
OPENVINO_TEST(${BACKEND_NAME}, onnx_normalize) {
|
||||
const auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(ov::test::utils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/normalize.onnx"));
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
std::vector<float> data(12);
|
||||
std::iota(data.begin(), data.end(), 1.f);
|
||||
std::vector<float> output = {
|
||||
@ -282,7 +283,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_swish_with_beta) {
|
||||
file_util::path_join(ov::test::utils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/swish_with_beta.onnx"));
|
||||
|
||||
const Shape expected_output_shape{3};
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
std::vector<float> input_data{-0.5f, 0, 0.5f};
|
||||
test_case.add_input<float>(input_data);
|
||||
test_case.add_expected_output<float>(expected_output_shape, {-0.2036667f, 0.0f, 0.2963333f});
|
||||
@ -296,7 +297,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_swish_without_beta) {
|
||||
"onnx/swish_without_beta.onnx"));
|
||||
|
||||
const Shape expected_output_shape{3};
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
std::vector<float> input_data{-0.5f, 0, 0.5f};
|
||||
test_case.add_input<float>(input_data);
|
||||
test_case.add_expected_output<float>(expected_output_shape, {-0.18877034f, 0.0f, 0.31122968f});
|
||||
@ -310,7 +311,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_experimental_detectron_detection_outpu
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/org.openvinotoolkit/experimental_detectron/detection_output.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
// rois
|
||||
test_case.add_input<float>({1.0f, 1.0f, 10.0f, 10.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, 4.0f, 1.0f, 8.0f, 5.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f,
|
||||
@ -371,7 +372,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_experimental_detectron_detection_outpu
|
||||
"onnx/org.openvinotoolkit/experimental_detectron/"
|
||||
"detection_output_most_attrs_default.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
// rois
|
||||
test_case.add_input<float>({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, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f,
|
||||
@ -414,7 +415,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_experimental_detectron_generate_propos
|
||||
"onnx/org.openvinotoolkit/experimental_detectron/"
|
||||
"generate_proposals_single_image.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
// im_info
|
||||
test_case.add_input<float>({1.0f, 1.0f, 1.0f});
|
||||
// anchors
|
||||
@ -463,7 +464,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_experimental_detectron_group_norm) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/org.openvinotoolkit/experimental_detectron/group_norm.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
Shape shape{2, 8, 2, 2};
|
||||
const auto size = shape_size(shape);
|
||||
std::vector<float> data(size);
|
||||
@ -490,7 +491,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_experimental_detectron_prior_grid_gene
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/org.openvinotoolkit/experimental_detectron/prior_grid_generator.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
std::vector<float> priors(shape_size(Shape{3, 4}));
|
||||
std::iota(priors.begin(), priors.end(), 0.f);
|
||||
@ -517,7 +518,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_experimental_detectron_roi_feature_ext
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/org.openvinotoolkit/experimental_detectron/roi_feature_extractor.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
std::vector<float> rois(shape_size(Shape{2, 4}));
|
||||
std::iota(rois.begin(), rois.end(), 0.f);
|
||||
@ -576,7 +577,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_experimental_detectron_topk_rios) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/org.openvinotoolkit/experimental_detectron/topk_rios.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
test_case.add_input<float>({1.0f, 1.0f, 3.0f, 4.0f, 2.0f, 1.0f, 5.0f, 7.0f});
|
||||
test_case.add_input<float>({0.5f, 0.3f});
|
||||
@ -591,7 +592,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_deformable_conv_2d) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/org.openvinotoolkit/deformable_conv_2d.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
// data
|
||||
test_case.add_input<float>(
|
||||
@ -624,7 +625,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_generate_proposals) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/org.openvinotoolkit/generate_proposals.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
// scores
|
||||
test_case.add_input<float>(
|
||||
@ -677,7 +678,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_generate_proposals_batch) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/org.openvinotoolkit/generate_proposals_batch2.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
// scores
|
||||
test_case.add_input<float>(Shape{2, 3, 2, 3}, {5, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 7, 1, 1, 1, 1,
|
||||
|
@ -15,16 +15,17 @@
|
||||
|
||||
#include "common_test_utils/file_utils.hpp"
|
||||
#include "default_opset.hpp"
|
||||
#include "engines_util/test_case.hpp"
|
||||
#include "common_test_utils/test_case.hpp"
|
||||
#include "onnx_import/onnx.hpp"
|
||||
#include "common_test_utils/test_control.hpp"
|
||||
#include "onnx_utils.hpp"
|
||||
|
||||
OPENVINO_SUPPRESS_DEPRECATED_START
|
||||
|
||||
using namespace ngraph;
|
||||
|
||||
static std::string s_manifest = "${MANIFEST}";
|
||||
static std::string s_device = test::backend_name_to_device("${BACKEND_NAME}");
|
||||
static std::string s_device = backend_name_to_device("${BACKEND_NAME}");
|
||||
|
||||
OPENVINO_TEST(${BACKEND_NAME}, onnx_model_adaptive_avg_pooling2d_nchw) {
|
||||
const auto function =
|
||||
@ -32,7 +33,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_adaptive_avg_pooling2d_nchw) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/org.pytorch/adaptive_avg_pooling2d_nchw.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>({0.9945f,
|
||||
0.3466f,
|
||||
0.2894f,
|
||||
@ -59,7 +60,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_adaptive_avg_pooling2d_chw) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/org.pytorch/adaptive_avg_pooling2d_chw.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>({12.0f, -1.0f, -56.0f, 20.0f, 1.0f, -8.0f, 7.0f, 9.0f});
|
||||
|
||||
test_case.add_expected_output<float>(Shape{1, 2, 2}, {5.5f, -18.0f, -3.5f, 8.0f});
|
||||
|
@ -17,18 +17,19 @@
|
||||
#include "common_test_utils/file_utils.hpp"
|
||||
#include "common_test_utils/ndarray.hpp"
|
||||
#include "common_test_utils/ngraph_test_utils.hpp"
|
||||
#include "common_test_utils/test_case.hpp"
|
||||
#include "common_test_utils/test_control.hpp"
|
||||
#include "common_test_utils/test_tools.hpp"
|
||||
#include "engines_util/test_case.hpp"
|
||||
#include "gtest/gtest.h"
|
||||
#include "ngraph/ngraph.hpp"
|
||||
#include "onnx_import/onnx.hpp"
|
||||
#include "onnx_utils.hpp"
|
||||
|
||||
using namespace ngraph;
|
||||
OPENVINO_SUPPRESS_DEPRECATED_START
|
||||
|
||||
static std::string s_manifest = "${MANIFEST}";
|
||||
static std::string s_device = test::backend_name_to_device("${BACKEND_NAME}");
|
||||
static std::string s_device = backend_name_to_device("${BACKEND_NAME}");
|
||||
|
||||
using Inputs = std::vector<std::vector<float>>;
|
||||
using Outputs = std::vector<std::vector<float>>;
|
||||
@ -38,7 +39,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_quantize_linear_const_scale_const_zero
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/quantize_linear_const.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input(std::vector<float>{32.25f, 48.34f, 50.f, 83.f});
|
||||
|
||||
test_case.add_expected_output(std::vector<std::uint8_t>{64, 97, 100, 166});
|
||||
@ -49,7 +50,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_quantize_linear) {
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(ov::test::utils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/quantize_linear.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input(std::vector<float>{32.25f, 48.34f, 50.f, 83.f});
|
||||
test_case.add_input(std::vector<float>{0.5f});
|
||||
|
||||
@ -62,7 +63,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_quantize_linear_zero_point) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/quantize_linear_zero_point.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input(std::vector<float>{0.f, 2.f, 3.f, 1000.f, -254.f, -1000.f}); // x
|
||||
test_case.add_input(std::vector<float>{2.0f}); // y_scale
|
||||
test_case.add_input(std::vector<std::uint8_t>{128}); // y_zero_point
|
||||
@ -76,7 +77,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_quantize_linear_axis_zero) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/quantize_linear_axis_zero.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input(std::vector<float>{0.f, 2.f, 3.f, 1000.f, 0.f, 2.f, 3.f, 1000.f, 0.f, 2.f, 3.f, 1000.f}); // x
|
||||
test_case.add_input(std::vector<float>{1.f, 2.f, 4.f}); // y_scale
|
||||
test_case.add_input(std::vector<std::uint8_t>{0, 0, 0}); // y_zero_point
|
||||
@ -94,7 +95,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_quantize_linear_axis_negative) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/quantize_linear_axis_negative.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input(std::vector<float>{0.f, 2.f, 3.f, 1000.f, 0.f, 2.f, 3.f, 1000.f, 0.f, 2.f, 3.f, 1000.f}); // x
|
||||
test_case.add_input(std::vector<float>{1.f, 2.f, 4.f}); // y_scale
|
||||
test_case.add_input(std::vector<std::uint8_t>{0, 0, 0}); // y_zero_point
|
||||
@ -113,7 +114,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_quantize_linear_scalar_ignore_axis) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/quantize_linear_scalar_ignore_axis.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input(std::vector<float>{-256.0f, -250.0f, 0.0f, 254.0f}); // x
|
||||
test_case.add_input(std::vector<float>{2.0f}); // scale
|
||||
test_case.add_input(std::vector<uint8_t>{128}); // zero_point
|
||||
@ -126,7 +127,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_dequantize_linear) {
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(ov::test::utils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/dequant_lin.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input(std::vector<std::uint8_t>{19, 210, 21, 10});
|
||||
|
||||
test_case.add_expected_output(std::vector<float>{76.f, 840.f, 84.f, 40.f});
|
||||
@ -139,7 +140,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_dequantize_linear_scalar_scale_and_zer
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dequantize_linear_scalar_scale_and_zero_point.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input(std::vector<std::uint8_t>{19, 210, 21, 10}); // x
|
||||
test_case.add_input(std::vector<float>{2.0f}); // scale
|
||||
test_case.add_input(std::vector<uint8_t>{128}); // zero_point
|
||||
@ -153,7 +154,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_dequantize_linear_scalar_scale) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dequantize_linear_scalar_scale.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input(std::vector<std::uint8_t>{19, 210, 21, 10}); // x
|
||||
test_case.add_input(std::vector<float>{2.0f}); // scale
|
||||
test_case.add_input(std::vector<uint8_t>{128, 7}); // zero_point
|
||||
@ -167,7 +168,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_dequantize_linear_scalar_inputs) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dequantize_linear_scalar_inputs.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input(std::vector<std::uint8_t>{19}); // x
|
||||
test_case.add_input(std::vector<float>{2.0f}); // scale
|
||||
test_case.add_input(std::vector<uint8_t>{128}); // zero_point
|
||||
@ -182,7 +183,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_dequantize_linear_scalar_zero_point) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dequantize_linear_scalar_zero_point.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input(std::vector<std::uint8_t>{19, 210, 21, 10}); // x
|
||||
test_case.add_input(std::vector<float>{2.0f, 1.0f}); // scale
|
||||
test_case.add_input(std::vector<uint8_t>{128}); // zero_point
|
||||
@ -196,7 +197,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_dequantize_linear_no_zero_point) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dequantize_linear_no_zero_point.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input(std::vector<std::uint8_t>{19, 210, 21, 10}); // x
|
||||
test_case.add_input(std::vector<float>{2.0f, 1.0f}); // scale
|
||||
|
||||
@ -209,7 +210,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_dequantize_linear_scalar_zero_scale_ui
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dequantize_linear_0.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input(std::vector<uint8_t>{0, 3, 128, 255}); // x
|
||||
test_case.add_input(std::vector<float>{2.0f}); // scale
|
||||
test_case.add_input(std::vector<uint8_t>{128}); // zero_point
|
||||
@ -223,7 +224,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_dequantize_linear_scalar_zero_scale_in
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dequantize_linear_1.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
test_case.add_input(std::vector<int8_t>{-30, -3, 100, 127}); // x
|
||||
test_case.add_input(std::vector<float>{2.0f}); // scale
|
||||
@ -238,7 +239,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_dequantize_linear_1d_zero_scale_uint8)
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dequantize_linear_2.onnx"));
|
||||
|
||||
auto test_case = ngraph::test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
test_case.add_input(std::vector<uint8_t>{0, 1, 2, 3, 0, 1, 2, 3, 0, 10, 20, 30}); // x
|
||||
test_case.add_input(std::vector<float>{1.0f, 2.0f, 4.0f}); // scale
|
||||
@ -255,7 +256,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_dequantize_linear_1d_zero_scale_int8)
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dequantize_linear_3.onnx"));
|
||||
|
||||
auto test_case = ngraph::test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
test_case.add_input(std::vector<int8_t>{0, 1, 2, 3, 0, 2, 4, 6, 0, 10, 20, 30}); // x
|
||||
test_case.add_input(std::vector<float>{1.0f, 2.0f, 4.0f, 8.0f}); // scale
|
||||
@ -272,7 +273,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_dequantize_linear_1d_zero_scale_int8_4
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dequantize_linear_4_dynamic.onnx"));
|
||||
|
||||
auto test_case = ngraph::test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
// The `axis` sttribute is set to 1
|
||||
// The data input shape in the onnx model is {-1, -1, -1, -1}
|
||||
@ -297,7 +298,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_dequantize_linear_1d_zero_scale_int8_4
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dequantize_linear_4.onnx"));
|
||||
|
||||
auto test_case = ngraph::test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
test_case.add_input(std::vector<int8_t>{7, 9, 10, 10, 5, 8, 9, 1, 8, 6, 7, 9, 10, 0, 7, 10,
|
||||
8, 2, 6, 0, 5, 9, 8, 1, 2, 7, 5, 3, 2, 4, 1, 3,
|
||||
@ -320,7 +321,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_dequantize_linear_1d_zero_scale_uint8_
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dequantize_linear_5.onnx"));
|
||||
|
||||
auto test_case = ngraph::test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
test_case.add_input(std::vector<uint8_t>{0, 1, 2, 3, 0, 1, 2, 3, 0, 10, 20, 30}); // x
|
||||
test_case.add_input(std::vector<float>{1.0f, 2.0f, 4.0f}); // scale
|
||||
@ -338,7 +339,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_dequantize_linear_scalar_ignore_axis)
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dequantize_linear_scalar_ignore_axis.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input(std::vector<uint8_t>{0, 3, 128, 255}); // x
|
||||
test_case.add_input(std::vector<float>{2.0f}); // scale
|
||||
test_case.add_input(std::vector<uint8_t>{128}); // zero_point
|
||||
@ -353,7 +354,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_dynamic_quantize_linear) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/quantization/dynamic_quantize_linear.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>({0.f, 2.f, -3.f, -2.5f, 1.34f, 0.5f});
|
||||
test_case.add_expected_output<uint8_t>(Shape{6}, {153, 255, 0, 25, 221, 179});
|
||||
test_case.add_expected_output<float>(Shape{}, {0.0196078438f});
|
||||
@ -367,7 +368,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_dynamic_quantize_linear_255) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/quantization/dynamic_quantize_linear.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>({-1.f, -2.1f, -1.3f, -2.5f, -3.34f, -4.f});
|
||||
test_case.add_expected_output<uint8_t>(Shape{6}, {191, 121, 172, 96, 42, 0});
|
||||
test_case.add_expected_output<float>(Shape{}, {0.0156862754f});
|
||||
@ -381,7 +382,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_dynamic_quantize_linear_3x4) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/quantization/dynamic_quantize_linear_3x4.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
// don't change style for better readibility
|
||||
// clang-format off
|
||||
@ -402,7 +403,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_quant_conv_linear) {
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(ov::test::utils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/quant_conv_lin.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
// don't change style for better readibility
|
||||
// clang-format off
|
||||
@ -433,7 +434,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_quant_conv_linear_2d) {
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(ov::test::utils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/qlinear_conv_2d.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
test_case.add_input_from_file<uint8_t>(
|
||||
file_util::path_join(ov::test::utils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/files/qlinearconv2d/x.bin"));
|
||||
@ -454,7 +455,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_quant_conv_linear_3d) {
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(ov::test::utils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/qlinear_conv_3d.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
// don't change style for better readibility
|
||||
// clang-format off
|
||||
@ -515,7 +516,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_quant_conv_linear_onnx_example) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/quantization/quant_conv_linear_onnx_example.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
// don't change style for better readibility
|
||||
// clang-format off
|
||||
@ -549,7 +550,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_qlinear_matmul_2d) {
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(ov::test::utils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/qlinear_matmul.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
test_case.add_input(std::vector<uint8_t>{208, 236, 0, 238, 3, 214, 255, 29}); // T1
|
||||
test_case.add_input(std::vector<float>{0.0066f}); // a_scale
|
||||
@ -568,7 +569,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_matmul_integer_2d_simple_zero_point) {
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(ov::test::utils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/matmul_integer.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
// don't change style for better readibility
|
||||
// clang-format off
|
||||
@ -595,7 +596,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_matmul_integer_int8) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/matmul_integer_int8.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
// don't change style for better readibility
|
||||
// clang-format off
|
||||
@ -620,7 +621,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_matmul_integer_vectorized_zero_point)
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/matmul_integer_vectorized_zero_point.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
// don't change style for better readibility
|
||||
// clang-format off
|
||||
@ -649,7 +650,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_matmul_integer_no_zero_point) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/matmul_integer_no_zero_point.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
// don't change style for better readibility
|
||||
// clang-format off
|
||||
@ -676,7 +677,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_matmul_integer_2d_x_3d) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/matmul_integer_2d_x_3d.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
// don't change style for better readibility
|
||||
// clang-format off
|
||||
@ -707,7 +708,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_matmul_integer_3d_x_2d) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/matmul_integer_3d_x_2d.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
// don't change style for better readibility
|
||||
// clang-format off
|
||||
@ -736,7 +737,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_matmul_integer_3d) {
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(ov::test::utils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/matmul_integer_3d.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
// don't change style for better readibility
|
||||
// clang-format off
|
||||
@ -771,7 +772,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_matmul_integer_4d) {
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(ov::test::utils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/matmul_integer_4d.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
// don't change style for better readibility
|
||||
// clang-format off
|
||||
@ -810,7 +811,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_matmul_integer_4d_zero_point) {
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(ov::test::utils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/matmul_integer_4d.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
// don't change style for better readibility
|
||||
// clang-format off
|
||||
@ -849,7 +850,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_matmul_integer_matrix_zero_point) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/matmul_integer_matrix_zero_point.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
// don't change style for better readibility
|
||||
// clang-format off
|
||||
@ -889,7 +890,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_qlinear_matmul_3d) {
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(ov::test::utils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/qlinear_matmul_3d.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
test_case.add_input(
|
||||
std::vector<uint8_t>{208, 236, 0, 238, 3, 214, 255, 29, 208, 236, 0, 238, 3, 214, 255, 29}); // T1
|
||||
@ -911,7 +912,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_conv_integer_simple_zero_point) {
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(ov::test::utils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/conv_integer.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
// don't change style for better readibility
|
||||
// clang-format off
|
||||
@ -934,7 +935,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_conv_integer_scalar_zp) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/conv_integer_scalar_zp.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
// clang-format off
|
||||
test_case.add_input(std::vector<uint8_t>{11, 22, 33,
|
||||
@ -955,7 +956,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_conv_integer_int8) {
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(ov::test::utils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/conv_integer_int8.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
// don't change style for better readibility
|
||||
// clang-format off
|
||||
@ -978,7 +979,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_conv_integer_no_zero_point) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/conv_integer_no_zero_point.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
// don't change style for better readibility
|
||||
// clang-format off
|
||||
@ -999,7 +1000,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_conv_integer_vector_w_zero_point) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/conv_integer_vector_w_zero_point.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
// don't change style for better readibility
|
||||
// clang-format off
|
||||
@ -1044,7 +1045,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_conv_integer_overload) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/conv_integer_overload.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
// don't change style for better readibility
|
||||
// clang-format off
|
||||
@ -1086,7 +1087,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_fake_quantize_const_inputs_infer) {
|
||||
std::vector<float> input_data(n_elements);
|
||||
std::iota(std::begin(input_data), std::end(input_data), 0.f);
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>(input_data);
|
||||
test_case.add_expected_output<float>(
|
||||
data_shape,
|
||||
@ -1106,7 +1107,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_fake_quantize_nonconst_inputs_infer) {
|
||||
std::vector<float> input_data(n_elements);
|
||||
std::iota(std::begin(input_data), std::end(input_data), 0.f);
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>(input_data);
|
||||
// input_low
|
||||
test_case.add_input<float>({3.f});
|
||||
@ -1129,7 +1130,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_quantize_linear_opset10) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/quantize_linear_opset10.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input(std::vector<float>{32.25f, 48.34f, 50.f, 83.f});
|
||||
test_case.add_input(std::vector<float>{0.5f});
|
||||
test_case.add_input(std::vector<uint8_t>{0});
|
||||
@ -1144,7 +1145,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_quantize_linear_opsets_10_and_13_axis0
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/quantize_linear_opsets_10_and_13_axis0.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input(std::vector<float>{32.25f, 48.34f, 50.f, 83.f});
|
||||
test_case.add_input(std::vector<float>{0.5f, 1.0f});
|
||||
test_case.add_input(std::vector<uint8_t>{0, 0});
|
||||
@ -1159,7 +1160,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_quantize_linear_opsets_10_and_13_axis1
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/quantize_linear_opsets_10_and_13_axis1.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input(std::vector<float>{32.25f, 48.34f, 50.f, 83.f});
|
||||
test_case.add_input(std::vector<float>{1.0f, 0.5f});
|
||||
test_case.add_input(std::vector<uint8_t>{0, 0});
|
||||
|
@ -15,20 +15,20 @@
|
||||
#include "common_test_utils/all_close.hpp"
|
||||
#include "common_test_utils/file_utils.hpp"
|
||||
#include "common_test_utils/ndarray.hpp"
|
||||
#include "common_test_utils/test_case.hpp"
|
||||
#include "common_test_utils/test_control.hpp"
|
||||
#include "common_test_utils/test_tools.hpp"
|
||||
#include "engines_util/execute_tools.hpp"
|
||||
#include "engines_util/test_case.hpp"
|
||||
#include "gtest/gtest.h"
|
||||
#include "ngraph/ngraph.hpp"
|
||||
#include "onnx_import/onnx.hpp"
|
||||
#include "onnx_utils.hpp"
|
||||
|
||||
using namespace ngraph;
|
||||
|
||||
OPENVINO_SUPPRESS_DEPRECATED_START
|
||||
|
||||
static std::string s_manifest = "${MANIFEST}";
|
||||
static std::string s_device = test::backend_name_to_device("${BACKEND_NAME}");
|
||||
static std::string s_device = backend_name_to_device("${BACKEND_NAME}");
|
||||
|
||||
using Inputs = std::vector<std::vector<float>>;
|
||||
using Outputs = std::vector<std::vector<float>>;
|
||||
@ -48,7 +48,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_reshape_reduced_dims) {
|
||||
{12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23}})
|
||||
.get_vector();
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input(Shape{2, 3, 4}, input);
|
||||
test_case.add_expected_output(Shape{2, 12}, expected_output);
|
||||
test_case.run();
|
||||
@ -71,7 +71,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_reshape_reordered_dims) {
|
||||
{{18, 19, 20}, {21, 22, 23}}})
|
||||
.get_vector();
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input(Shape{2, 3, 4}, input);
|
||||
test_case.add_expected_output(Shape{4, 2, 3}, expected_output);
|
||||
test_case.run();
|
||||
@ -93,7 +93,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_reshape_extended_dims) {
|
||||
{{{16, 17}, {18, 19}}, {{20, 21}, {22, 23}}}})
|
||||
.get_vector();
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input(Shape{2, 3, 4}, input);
|
||||
test_case.add_expected_output(Shape{3, 2, 2, 2}, expected_output);
|
||||
test_case.run();
|
||||
@ -114,7 +114,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_reshape_single_dim) {
|
||||
test::NDArray<float, 1>({0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23})
|
||||
.get_vector();
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input(Shape{2, 3, 4}, input);
|
||||
test_case.add_expected_output(Shape{24}, expected_output);
|
||||
test_case.run();
|
||||
@ -152,7 +152,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_reshape_negative_dim) {
|
||||
{0.46147937f, 0.7805292f}}})
|
||||
.get_vector();
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input(Shape{2, 3, 4}, input);
|
||||
test_case.add_expected_output(Shape{2, 6, 2}, expected_output);
|
||||
test_case.run();
|
||||
@ -173,7 +173,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_reshape_negative_with_zero_dim) {
|
||||
{{12, 13}, {14, 15}, {16, 17}, {18, 19}, {20, 21}, {22, 23}}})
|
||||
.get_vector();
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input(Shape{2, 3, 4}, input);
|
||||
test_case.add_expected_output(Shape{2, 6, 2}, expected_output);
|
||||
test_case.run();
|
||||
@ -194,7 +194,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_reshape_output_shape_as_input) {
|
||||
{{12, 13}, {14, 15}, {16, 17}, {18, 19}, {20, 21}, {22, 23}}})
|
||||
.get_vector();
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input(Shape{2, 3, 4}, input);
|
||||
test_case.add_expected_output(Shape{2, 6, 2}, expected_output);
|
||||
test_case.run();
|
||||
@ -211,7 +211,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_depth_to_space) {
|
||||
11.f, 18.f, 26.f, 19.f, 27.f, 4.f, 12.f, 5.f, 13.f, 20.f, 28.f,
|
||||
21.f, 29.f, 6.f, 14.f, 7.f, 15.f, 22.f, 30.f, 23.f, 31.f};
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input(input);
|
||||
test_case.add_expected_output(expected_output);
|
||||
test_case.run();
|
||||
@ -228,7 +228,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_depth_to_space_v1) {
|
||||
11.f, 18.f, 26.f, 19.f, 27.f, 4.f, 12.f, 5.f, 13.f, 20.f, 28.f,
|
||||
21.f, 29.f, 6.f, 14.f, 7.f, 15.f, 22.f, 30.f, 23.f, 31.f};
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input(input);
|
||||
test_case.add_expected_output(expected_output);
|
||||
test_case.run();
|
||||
@ -246,7 +246,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_depth_to_space_crd) {
|
||||
7.f, 10.f, 14.f, 11.f, 15.f, 16.f, 20.f, 17.f, 21.f, 24.f, 28.f,
|
||||
25.f, 29.f, 18.f, 22.f, 19.f, 23.f, 26.f, 30.f, 27.f, 31.f};
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input(input);
|
||||
test_case.add_expected_output(expected_output);
|
||||
test_case.run();
|
||||
@ -309,7 +309,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_space_to_depth) {
|
||||
4.f, 6.f, 12.f, 14.f, 20.f, 22.f, 28.f, 30.f, 5.f, 7.f, 13.f, 15.f, 21.f, 23.f, 29.f, 31.f,
|
||||
};
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input(input);
|
||||
test_case.add_expected_output(expected_output);
|
||||
test_case.run();
|
||||
@ -359,7 +359,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_squeeze) {
|
||||
auto expected_output =
|
||||
test::NDArray<float, 2>({{1.0f, 2.0f}, {3.0f, 4.0f}, {5.0f, 6.0f}, {7.0f, 8.0f}}).get_vector();
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input(Shape{1, 4, 1, 1, 2}, input);
|
||||
test_case.add_expected_output(Shape{4, 2}, expected_output);
|
||||
test_case.run();
|
||||
@ -370,7 +370,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_squeeze_empty_axes_attribute) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/squeeze_empty_axes_attribute.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
const std::vector<float> data = {1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f};
|
||||
test_case.add_input<float>(Shape{1, 4, 1, 1, 2}, data);
|
||||
test_case.add_expected_output<float>(Shape{4, 2}, data);
|
||||
@ -382,7 +382,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_squeeze_opset13_no_axes) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/squeeze_opset13_no_axes.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
const std::vector<float> data = {1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f};
|
||||
test_case.add_input<float>(Shape{1, 4, 1, 1, 2}, data);
|
||||
test_case.add_expected_output<float>(Shape{4, 2}, data);
|
||||
@ -404,7 +404,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_unsqueeze) {
|
||||
{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}}}})
|
||||
.get_vector();
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input(input);
|
||||
test_case.add_expected_output(expected_output);
|
||||
test_case.run();
|
||||
@ -426,7 +426,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_unsqueeze_negative_axes) {
|
||||
{{{-0.05270234f, 0.7113202f, -0.45783648f, -1.3378475f, 0.26926285f}}}}})
|
||||
.get_vector();
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input(input);
|
||||
test_case.add_expected_output(expected_output);
|
||||
test_case.run();
|
||||
@ -443,7 +443,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_concat) {
|
||||
|
||||
auto expected_output = test::NDArray<float, 1>({1, 2, 3, 4}).get_vector();
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_multiple_inputs(inputs);
|
||||
test_case.add_expected_output(expected_output);
|
||||
test_case.run();
|
||||
@ -461,7 +461,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_concat_negative_axis) {
|
||||
|
||||
auto expected_output = test::NDArray<float, 2>({{1, 2}, {3, 4}, {5, 6}, {7, 8}}).get_vector();
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_multiple_inputs(inputs);
|
||||
test_case.add_expected_output(expected_output);
|
||||
test_case.run();
|
||||
@ -474,7 +474,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_split_equal_parts_default) {
|
||||
|
||||
Inputs inputs{{1, 2, 3, 4, 5, 6}};
|
||||
Outputs expected_outputs{{1, 2}, {3, 4}, {5, 6}};
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_multiple_inputs(inputs);
|
||||
|
||||
for (std::size_t i = 0; i < expected_outputs.size(); ++i) {
|
||||
@ -489,7 +489,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_split_equal_parts_2d) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/split_equal_parts_2d.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>({0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11});
|
||||
test_case.add_expected_output<float>({0, 1, 2, 6, 7, 8});
|
||||
test_case.add_expected_output<float>({3, 4, 5, 9, 10, 11});
|
||||
@ -502,7 +502,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_split_variable_parts_2d) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/split_variable_parts_2d.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>({0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11});
|
||||
test_case.add_expected_output<float>({0, 1, 6, 7});
|
||||
test_case.add_expected_output<float>({2, 3, 4, 5, 8, 9, 10, 11});
|
||||
@ -514,7 +514,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_expand_static_shape) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/expand_static_shape.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
// input data shape (3,1)
|
||||
test_case.add_input(std::vector<float>{1, 2, 3});
|
||||
|
||||
|
@ -17,18 +17,19 @@
|
||||
#include "common_test_utils/file_utils.hpp"
|
||||
#include "common_test_utils/ndarray.hpp"
|
||||
#include "common_test_utils/ngraph_test_utils.hpp"
|
||||
#include "common_test_utils/test_case.hpp"
|
||||
#include "common_test_utils/test_control.hpp"
|
||||
#include "common_test_utils/test_tools.hpp"
|
||||
#include "engines_util/test_case.hpp"
|
||||
#include "gtest/gtest.h"
|
||||
#include "ngraph/ngraph.hpp"
|
||||
#include "onnx_import/onnx.hpp"
|
||||
#include "onnx_utils.hpp"
|
||||
|
||||
using namespace ngraph;
|
||||
OPENVINO_SUPPRESS_DEPRECATED_START
|
||||
|
||||
static std::string s_manifest = "${MANIFEST}";
|
||||
static std::string s_device = test::backend_name_to_device("${BACKEND_NAME}");
|
||||
static std::string s_device = backend_name_to_device("${BACKEND_NAME}");
|
||||
|
||||
// ONNX LSTM tests (implemented by nGraph LSTMCell and LSTMSequence)
|
||||
OPENVINO_TEST(${BACKEND_NAME}, onnx_model_lstm_fwd_default_const) {
|
||||
@ -36,7 +37,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_lstm_fwd_default_const) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/lstm_fwd_default_const.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>({0.68172926f, 1.1405563f, -0.03931177f, -0.03759607f}); // X
|
||||
|
||||
test_case.add_expected_output<float>(Shape{2, 1, 1, 2},
|
||||
@ -52,7 +53,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_lstm_reverse_const) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/lstm_reverse_const.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>({0.68172926f, 1.1405563f, -0.03931177f, -0.03759607f}); // X
|
||||
|
||||
test_case.add_expected_output<float>(Shape{2, 1, 1, 2},
|
||||
@ -67,7 +68,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_lstm_bidir_const) {
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(ov::test::utils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/lstm_bidir_const.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>({0.68172926f, 1.1405563f, -0.03931177f, -0.03759607f}); // X
|
||||
|
||||
test_case.add_expected_output<float>(Shape{2, 2, 1, 2},
|
||||
@ -92,7 +93,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_lstm_fwd_with_clip_const) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/lstm_fwd_clip_const.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>({0.68172926f, 1.1405563f, -0.03931177f, -0.03759607f}); // X
|
||||
|
||||
test_case.add_expected_output<float>(Shape{2, 1, 1, 2},
|
||||
@ -108,7 +109,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_lstm_fwd_mixed_seq_const) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/lstm_fwd_mixed_seq_const.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>({0.68172926f, 1.1405563f, -0.03931177f, -0.03759607f}); // X
|
||||
|
||||
test_case.add_expected_output<float>(Shape{2, 1, 2, 3},
|
||||
@ -139,7 +140,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_lstm_reverse_mixed_seq_const) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/lstm_reverse_mixed_seq_const.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>({0.68172926f, 1.1405563f, -0.03931177f, -0.03759607f}); // X
|
||||
|
||||
test_case.add_expected_output<float>(Shape{2, 1, 2, 3},
|
||||
@ -170,7 +171,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_lstm_bidir_mixed_seq_const) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/lstm_bidir_mixed_seq_const.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>(
|
||||
{0.68172926f, 1.1405563f, -0.03931177f, -0.03759607f, 1.1397027f, 0.60444903f, 1.3246384f, -0.28191715f}); // X
|
||||
|
||||
@ -218,7 +219,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_lstm_fwd_with_clip_peepholes) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/lstm_fwd_with_clip_peepholes.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>({-0.455351f, -0.276391f, -0.185934f, -0.269585f}); // X
|
||||
test_case.add_input<float>({-0.494659f, // W
|
||||
0.0453352f,
|
||||
@ -286,7 +287,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_lstm_fwd_mixed_seq) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/lstm_fwd_mixed_seq.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
int hidden_size{3};
|
||||
test_case.add_input<float>({1.f, 2.f, 10.f, 11.f}); // X
|
||||
test_case.add_input<float>({0.1f, 0.2f, 0.3f, 0.4f, 1.f, 2.f, 3.f, 4.f, 10.f, 11.f, 12.f, 13.f}); // W
|
||||
@ -324,7 +325,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_lstm_fwd_hardsigmoid_activation) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/lstm_fwd_hardsigmoid_activation.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
// X
|
||||
test_case.add_input<float>({-0.455351f, -0.276391f, -0.185934f, -0.269585f});
|
||||
@ -379,7 +380,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_lstm_fwd_large_batch_no_clip) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/lstm_fwd_large_batch_no_clip.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
std::size_t seq_length = 2;
|
||||
std::size_t batch_size = 32;
|
||||
@ -421,7 +422,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_lstm_bdir_short_input_seq_peepholes) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/lstm_bdir_short_input_seq.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
// X
|
||||
test_case.add_input<float>({-0.455351f, -0.276391f, -0.185934f, -0.269585f});
|
||||
@ -467,7 +468,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_lstm_mixed_seq_reverse) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/lstm_mixed_seq_reverse.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
size_t hidden_size = 3;
|
||||
|
||||
@ -554,7 +555,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_lstm_dynamic_batch_size_and_seq_len) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/lstm_dynamic_batch_size_and_seq_len.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>({1, 2, 3, 4, 5, 6});
|
||||
|
||||
test_case.add_expected_output<float>(Shape{1, 1, 3, 2},
|
||||
@ -669,7 +670,7 @@ OPENVINO_TEST_F(${BACKEND_NAME}, GRUSequenceOp, onnx_model_gru_defaults_fwd_cons
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/gru_defaults_fwd_const.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>(in_X);
|
||||
|
||||
// Y
|
||||
@ -712,7 +713,7 @@ OPENVINO_TEST_F(${BACKEND_NAME}, GRUSequenceOp, onnx_model_gru_defaults_fwd) {
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(ov::test::utils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/gru_defaults_fwd.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
test_case.add_input<float>(in_X);
|
||||
test_case.add_input<float>(in_W);
|
||||
@ -761,7 +762,7 @@ OPENVINO_TEST_F(${BACKEND_NAME}, GRUSequenceOp, onnx_model_gru_fwd_activations_c
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/gru_fwd_activations_relu_sigmoid_const.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>(in_X);
|
||||
|
||||
// Y
|
||||
@ -803,7 +804,7 @@ OPENVINO_TEST_F(${BACKEND_NAME}, GRUSequenceOp, onnx_model_gru_fwd_activations_r
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/gru_fwd_activations_relu_hardsigmoid.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
test_case.add_input<float>(in_X);
|
||||
test_case.add_input<float>(in_W);
|
||||
@ -849,7 +850,7 @@ OPENVINO_TEST_F(${BACKEND_NAME}, GRUSequenceOp, onnx_model_gru_fwd_mixed_seq_len
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/gru_fwd_mixed_seq_len.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
test_case.add_input<float>(in_X);
|
||||
test_case.add_input<float>(in_W);
|
||||
@ -899,7 +900,7 @@ OPENVINO_TEST_F(${BACKEND_NAME}, GRUSequenceOp, onnx_model_gru_fwd_mixed_seq_len
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/gru_fwd_mixed_seq_len_const.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
test_case.add_input<float>(in_X);
|
||||
|
||||
@ -941,7 +942,7 @@ OPENVINO_TEST_F(${BACKEND_NAME}, GRUSequenceOp, onnx_model_gru_reverse_mixed_seq
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/gru_reverse_mixed_seq_len_const.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
test_case.add_input<float>(in_X);
|
||||
|
||||
@ -983,7 +984,7 @@ OPENVINO_TEST_F(${BACKEND_NAME}, GRUSequenceOp, onnx_model_gru_bidir_mixed_seq_l
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/gru_bidir_mixed_seq_len_const.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
test_case.add_input<float>(in_X);
|
||||
|
||||
@ -1024,7 +1025,7 @@ OPENVINO_TEST_F(${BACKEND_NAME}, GRUSequenceOp, onnx_model_gru_rev_clip) {
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(ov::test::utils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/gru_rev_clip.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
test_case.add_input<float>(in_X);
|
||||
test_case.add_input<float>(in_W);
|
||||
@ -1071,7 +1072,7 @@ OPENVINO_TEST_F(${BACKEND_NAME}, GRUSequenceOp, onnx_model_gru_rev_clip_const) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/gru_rev_clip_const.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>(in_X);
|
||||
|
||||
// Y
|
||||
@ -1114,7 +1115,7 @@ OPENVINO_TEST_F(${BACKEND_NAME}, GRUSequenceOp, onnx_model_gru_reverse_const) {
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(ov::test::utils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/gru_reverse_const.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>(in_X);
|
||||
|
||||
// Y
|
||||
@ -1157,7 +1158,7 @@ OPENVINO_TEST_F(${BACKEND_NAME}, GRUSequenceOp, onnx_model_gru_reverse) {
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(ov::test::utils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/gru_reverse.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
test_case.add_input<float>(in_X);
|
||||
test_case.add_input<float>(in_W);
|
||||
@ -1204,7 +1205,7 @@ OPENVINO_TEST_F(${BACKEND_NAME}, GRUSequenceOp, onnx_model_gru_fwd_bias_initial_
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/gru_fwd_bias_initial_h_const.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>(in_X);
|
||||
|
||||
// Y
|
||||
@ -1248,7 +1249,7 @@ OPENVINO_TEST_F(${BACKEND_NAME}, GRUSequenceOp, onnx_model_gru_fwd_bias_initial_
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/gru_fwd_bias_initial_h.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
test_case.add_input<float>(in_X);
|
||||
test_case.add_input<float>(in_W);
|
||||
@ -1297,7 +1298,7 @@ OPENVINO_TEST_F(${BACKEND_NAME}, GRUSequenceOp, onnx_model_gru_bidirectional_con
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/gru_bidirectional_const.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>(in_X);
|
||||
|
||||
// Y
|
||||
@ -1339,7 +1340,7 @@ OPENVINO_TEST_F(${BACKEND_NAME}, GRUSequenceOp, onnx_model_gru_bidirectional) {
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(ov::test::utils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/gru_bidirectional.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
test_case.add_input<float>(in_X);
|
||||
test_case.add_input<float>(in_bdir_W);
|
||||
@ -1385,7 +1386,7 @@ OPENVINO_TEST_F(${BACKEND_NAME}, GRUSequenceOp, onnx_model_gru_fwd_linear_before
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/gru_fwd_linear_before_reset_const.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>(in_X);
|
||||
|
||||
// Y
|
||||
@ -1429,7 +1430,7 @@ OPENVINO_TEST_F(${BACKEND_NAME}, GRUSequenceOp, onnx_model_gru_fwd_linear_before
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/gru_fwd_linear_before_reset.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
test_case.add_input<float>(in_X);
|
||||
test_case.add_input<float>(in_W);
|
||||
@ -1478,7 +1479,7 @@ OPENVINO_TEST_F(${BACKEND_NAME}, GRUSequenceOp, onnx_model_gru_defaults_fwd_cons
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dynamic_shapes/gru_defaults_fwd_const_dynamic.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>(Shape{4, 3, 2}, in_X);
|
||||
|
||||
// Y
|
||||
@ -1624,7 +1625,7 @@ OPENVINO_TEST_F(${BACKEND_NAME}, RNNSequenceOp, onnx_model_rnn_defaults_fwd_cons
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/rnn_defaults_fwd_const.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>(in_X);
|
||||
|
||||
// Y
|
||||
@ -1667,7 +1668,7 @@ OPENVINO_TEST_F(${BACKEND_NAME}, RNNSequenceOp, onnx_model_rnn_defaults_fwd) {
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(ov::test::utils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/rnn_defaults_fwd.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
test_case.add_input<float>(in_X);
|
||||
test_case.add_input<float>(in_W);
|
||||
@ -1714,7 +1715,7 @@ OPENVINO_TEST_F(${BACKEND_NAME}, RNNSequenceOp, onnx_model_rnn_fwd_activations_c
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/rnn_fwd_activations_const.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
test_case.add_input<float>(in_X);
|
||||
|
||||
@ -1758,7 +1759,7 @@ OPENVINO_TEST_F(${BACKEND_NAME}, RNNSequenceOp, onnx_model_rnn_fwd_activations)
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/rnn_fwd_activations.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
test_case.add_input<float>(in_X);
|
||||
test_case.add_input<float>(in_W);
|
||||
@ -1804,7 +1805,7 @@ OPENVINO_TEST_F(${BACKEND_NAME}, RNNSequenceOp, onnx_model_rnn_fwd_mixed_seq_len
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/rnn_fwd_mixed_seq_len_const.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>(in_X);
|
||||
|
||||
// Y
|
||||
@ -1848,7 +1849,7 @@ OPENVINO_TEST_F(${BACKEND_NAME}, RNNSequenceOp, onnx_model_rnn_fwd_mixed_seq_len
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/rnn_fwd_mixed_seq_len.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
test_case.add_input<float>(in_X);
|
||||
test_case.add_input<float>(in_W);
|
||||
@ -1898,7 +1899,7 @@ OPENVINO_TEST_F(${BACKEND_NAME}, RNNSequenceOp, onnx_model_rnn_reverse_mixed_seq
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/rnn_reverse_mixed_seq_len_const.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>(in_X);
|
||||
|
||||
// Y
|
||||
@ -1938,7 +1939,7 @@ OPENVINO_TEST_F(${BACKEND_NAME}, RNNSequenceOp, onnx_model_rnn_bidir_mixed_seq_l
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/rnn_bidir_mixed_seq_len_const.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>(in_X);
|
||||
|
||||
// Y
|
||||
@ -1982,7 +1983,7 @@ OPENVINO_TEST_F(${BACKEND_NAME}, RNNSequenceOp, onnx_model_rnn_rev_clip_const) {
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/rnn_rev_clip_const.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>(in_X);
|
||||
|
||||
// Y
|
||||
@ -2025,7 +2026,7 @@ OPENVINO_TEST_F(${BACKEND_NAME}, RNNSequenceOp, onnx_model_rnn_rev_clip) {
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(ov::test::utils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/rnn_rev_clip.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
test_case.add_input<float>(in_X);
|
||||
test_case.add_input<float>(in_W);
|
||||
@ -2071,7 +2072,7 @@ OPENVINO_TEST_F(${BACKEND_NAME}, RNNSequenceOp, onnx_model_rnn_reverse_const) {
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(ov::test::utils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/rnn_reverse_const.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>(in_X);
|
||||
|
||||
// Y
|
||||
@ -2114,7 +2115,7 @@ OPENVINO_TEST_F(${BACKEND_NAME}, RNNSequenceOp, onnx_model_rnn_reverse) {
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(ov::test::utils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/rnn_reverse.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
test_case.add_input<float>(in_X);
|
||||
test_case.add_input<float>(in_W);
|
||||
@ -2161,7 +2162,7 @@ OPENVINO_TEST_F(${BACKEND_NAME}, RNNSequenceOp, onnx_model_rnn_fwd_bias_initial_
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/rnn_fwd_bias_initial_h_const.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>(in_X);
|
||||
|
||||
// Y
|
||||
@ -2205,7 +2206,7 @@ OPENVINO_TEST_F(${BACKEND_NAME}, RNNSequenceOp, onnx_model_rnn_fwd_bias_initial_
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/rnn_fwd_bias_initial_h.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
test_case.add_input<float>(in_X);
|
||||
test_case.add_input<float>(in_W);
|
||||
@ -2253,7 +2254,7 @@ OPENVINO_TEST_F(${BACKEND_NAME}, RNNSequenceOp, onnx_model_rnn_bidirectional) {
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(ov::test::utils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/rnn_bidirectional.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
test_case.add_input<float>(in_X);
|
||||
test_case.add_input<float>(in_bdir_W);
|
||||
@ -2300,7 +2301,7 @@ OPENVINO_TEST_F(${BACKEND_NAME}, RNNSequenceOp, onnx_model_rnn_bidirectional_con
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/rnn_bidirectional_const.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
test_case.add_input<float>(in_X);
|
||||
|
||||
@ -2346,7 +2347,7 @@ OPENVINO_TEST_F(${BACKEND_NAME}, RNNSequenceOp, onnx_model_rnn_defaults_fwd_cons
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dynamic_shapes/rnn_defaults_fwd_const_dynamic.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>(Shape{4, 3, 2}, in_X);
|
||||
|
||||
// Y
|
||||
|
@ -15,21 +15,22 @@
|
||||
|
||||
#include "common_test_utils/file_utils.hpp"
|
||||
#include "default_opset.hpp"
|
||||
#include "engines_util/test_case.hpp"
|
||||
#include "common_test_utils/test_case.hpp"
|
||||
#include "onnx_import/onnx.hpp"
|
||||
#include "common_test_utils/test_control.hpp"
|
||||
#include "onnx_utils.hpp"
|
||||
|
||||
OPENVINO_SUPPRESS_DEPRECATED_START
|
||||
|
||||
using namespace ngraph;
|
||||
|
||||
static std::string s_manifest = "${MANIFEST}";
|
||||
static std::string s_device = test::backend_name_to_device("${BACKEND_NAME}");
|
||||
static std::string s_device = backend_name_to_device("${BACKEND_NAME}");
|
||||
|
||||
OPENVINO_TEST(${BACKEND_NAME}, onnx_model_dft) {
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(ov::test::utils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/dft.onnx"));
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>(Shape{3, 5, 2}, {0.000000f, 0.000000f, 1.000000f, 0.000000f, 2.000000f, 0.000000f,
|
||||
3.000000f, 0.000000f, 4.000000f, 0.000000f, 5.000000f, 0.000000f,
|
||||
6.000000f, 0.000000f, 7.000000f, 0.000000f, 8.000000f, 0.000000f,
|
||||
@ -46,7 +47,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_dft) {
|
||||
OPENVINO_TEST(${BACKEND_NAME}, onnx_model_dft_only_real) {
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(ov::test::utils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/dft_only_real.onnx"));
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>(Shape{3, 5, 1},
|
||||
{
|
||||
0.000000f,
|
||||
@ -76,7 +77,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_dft_only_real) {
|
||||
OPENVINO_TEST(${BACKEND_NAME}, onnx_model_dft_onesided) {
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(ov::test::utils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/dft_onesided.onnx"));
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>(
|
||||
Shape{2, 4},
|
||||
{0.000000f, 1.000000f, 2.000000f, 3.000000f, 4.000000f, 5.000000f, 6.000000f, 7.000000f});
|
||||
@ -100,7 +101,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_dft_onesided_skip_convert_to_complex)
|
||||
onnx_import::import_onnx_model(file_util::path_join(ov::test::utils::getExecutableDirectory(),
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dft_onesided_skip_convert_to_complex.onnx"));
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>(
|
||||
Shape{2, 4, 1},
|
||||
{0.000000f, 1.000000f, 2.000000f, 3.000000f, 4.000000f, 5.000000f, 6.000000f, 7.000000f});
|
||||
@ -123,7 +124,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_dft_length_provided) {
|
||||
auto function = onnx_import::import_onnx_model(file_util::path_join(ov::test::utils::getExecutableDirectory(),
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dft_lenght_provided.onnx"));
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>(Shape{3, 5, 2}, {0.000000f, 0.000000f, 1.000000f, 0.000000f, 2.000000f, 0.000000f,
|
||||
3.000000f, 0.000000f, 4.000000f, 0.000000f, 5.000000f, 0.000000f,
|
||||
6.000000f, 0.000000f, 7.000000f, 0.000000f, 8.000000f, 0.000000f,
|
||||
@ -138,7 +139,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_dft_length_provided_onesided) {
|
||||
auto function = onnx_import::import_onnx_model(file_util::path_join(ov::test::utils::getExecutableDirectory(),
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dft_lenght_provided_onesided.onnx"));
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>(Shape{4, 3},
|
||||
{0.000000f,
|
||||
1.000000f,
|
||||
@ -159,7 +160,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_dft_length_provided_onesided) {
|
||||
OPENVINO_TEST(${BACKEND_NAME}, onnx_model_dft_inverse) {
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(ov::test::utils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/dft_inverse.onnx"));
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>(Shape{3, 5, 2}, {0.000000f, 0.000000f, 1.000000f, 0.000000f, 2.000000f, 0.000000f,
|
||||
3.000000f, 0.000000f, 4.000000f, 0.000000f, 5.000000f, 0.000000f,
|
||||
6.000000f, 0.000000f, 7.000000f, 0.000000f, 8.000000f, 0.000000f,
|
||||
@ -177,7 +178,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_dft_inverse_only_real) {
|
||||
auto function = onnx_import::import_onnx_model(file_util::path_join(ov::test::utils::getExecutableDirectory(),
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dft_inverse_only_real.onnx"));
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>(Shape{3, 5, 1},
|
||||
{0.000000f,
|
||||
1.000000f,
|
||||
@ -206,7 +207,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_dft_inverse_onesided) {
|
||||
auto function = onnx_import::import_onnx_model(file_util::path_join(ov::test::utils::getExecutableDirectory(),
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dft_inverse_onesided.onnx"));
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>(Shape{2, 3, 2},
|
||||
{6.000000f,
|
||||
0.000000f,
|
||||
@ -229,7 +230,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_dft_inverse_onesided_real_input) {
|
||||
auto function = onnx_import::import_onnx_model(file_util::path_join(ov::test::utils::getExecutableDirectory(),
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dft_inverse_onesided_real_input.onnx"));
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>(Shape{2, 3, 1}, {1.000000f, 0.000000f, -1.000000f, 0.5000000f, -0.5000000f, 0.000000f});
|
||||
test_case.add_expected_output<float>(Shape{2, 3, 1},
|
||||
{0.750000f, -0.250000f, -0.500000f, 0.250000f, 0.250000f, -0.500000f});
|
||||
@ -239,7 +240,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_dft_inversed_length_provided) {
|
||||
auto function = onnx_import::import_onnx_model(file_util::path_join(ov::test::utils::getExecutableDirectory(),
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dft_inversed_lenght_provided.onnx"));
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>(Shape{3, 5, 2}, {0.000000f, 0.000000f, 1.000000f, 0.000000f, 2.000000f, 0.000000f,
|
||||
3.000000f, 0.000000f, 4.000000f, 0.000000f, 5.000000f, 0.000000f,
|
||||
6.000000f, 0.000000f, 7.000000f, 0.000000f, 8.000000f, 0.000000f,
|
||||
@ -255,7 +256,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_dft_inverse_length_provided_onesided)
|
||||
onnx_import::import_onnx_model(file_util::path_join(ov::test::utils::getExecutableDirectory(),
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dft_inverse_lenght_provided_onesided.onnx"));
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>(Shape{1, 3, 2}, {0.000000f, 0.000000f, 1.000000f, 0.000000f, 2.000000f, 0.000000f});
|
||||
test_case.add_expected_output<float>(Shape{4, 3},
|
||||
{0.000000f,
|
||||
@ -277,7 +278,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_stft_onesided_real_input_no_window_def
|
||||
file_util::path_join(ov::test::utils::getExecutableDirectory(),
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/stft_onesided_real_input_no_window_default_length.onnx"));
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
const Shape signal_shape{1, 128, 1};
|
||||
std::vector<float> signal(ov::shape_size(signal_shape));
|
||||
std::iota(std::begin(signal), std::end(signal), 0.f);
|
||||
@ -318,7 +319,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_stft_no_onesided_real_input_no_window_
|
||||
file_util::path_join(ov::test::utils::getExecutableDirectory(),
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/stft_no_onesided_real_input_no_window_default_length.onnx"));
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
const Shape signal_shape{1, 128, 1};
|
||||
std::vector<float> signal(ov::shape_size(signal_shape));
|
||||
std::iota(std::begin(signal), std::end(signal), 0.f);
|
||||
@ -380,7 +381,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_stft_no_onesided_complex_input_no_wind
|
||||
file_util::path_join(ov::test::utils::getExecutableDirectory(),
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/stft_no_onesided_complex_input_no_window_default_length.onnx"));
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
const Shape signal_shape{1, 128, 2};
|
||||
std::vector<float> signal(ov::shape_size(signal_shape));
|
||||
std::iota(std::begin(signal), std::end(signal), 0.f);
|
||||
@ -873,7 +874,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_stft_no_onesided_complex_input_no_wind
|
||||
file_util::path_join(ov::test::utils::getExecutableDirectory(),
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/stft_no_onesided_complex_input_no_window_default_length_2.onnx"));
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
const Shape signal_shape{2, 64, 2};
|
||||
std::vector<float> signal(ov::shape_size(signal_shape));
|
||||
std::iota(std::begin(signal), std::end(signal), 0.f);
|
||||
@ -950,7 +951,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_stft_no_onesided_complex_input_no_wind
|
||||
file_util::path_join(ov::test::utils::getExecutableDirectory(),
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/stft_no_onesided_complex_input_no_window_no_default_length.onnx"));
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
const Shape signal_shape{4, 32, 2};
|
||||
std::vector<float> signal(ov::shape_size(signal_shape));
|
||||
std::iota(std::begin(signal), std::end(signal), 0.f);
|
||||
@ -1347,7 +1348,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_stft_no_onesided_complex_input_given_w
|
||||
file_util::path_join(ov::test::utils::getExecutableDirectory(),
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/stft_no_onesided_complex_input_given_window_default_length.onnx"));
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
const Shape signal_shape{3, 32, 2};
|
||||
std::vector<float> signal(ov::shape_size(signal_shape));
|
||||
std::iota(std::begin(signal), std::end(signal), 0.f);
|
||||
@ -1431,7 +1432,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_stft_no_onesided_complex_input_given_w
|
||||
file_util::path_join(ov::test::utils::getExecutableDirectory(),
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/stft_no_onesided_complex_input_given_window_no_default_length.onnx"));
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
const Shape signal_shape{2, 48, 2};
|
||||
std::vector<float> signal(ov::shape_size(signal_shape));
|
||||
std::iota(std::begin(signal), std::end(signal), 0.f);
|
||||
@ -1488,7 +1489,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_stft_onesided_real_input_given_window_
|
||||
file_util::path_join(ov::test::utils::getExecutableDirectory(),
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/stft_onesided_real_input_given_window_no_default_length.onnx"));
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
const Shape signal_shape{2, 32, 1};
|
||||
std::vector<float> signal(ov::shape_size(signal_shape));
|
||||
std::iota(std::begin(signal), std::end(signal), 0.f);
|
||||
|
@ -13,16 +13,17 @@
|
||||
|
||||
#include "common_test_utils/file_utils.hpp"
|
||||
#include "editor.hpp"
|
||||
#include "engines_util/test_case.hpp"
|
||||
#include "common_test_utils/test_case.hpp"
|
||||
#include "gtest/gtest.h"
|
||||
#include "ngraph/ngraph.hpp"
|
||||
#include "common_test_utils/test_control.hpp"
|
||||
#include "onnx_utils.hpp"
|
||||
|
||||
using namespace ngraph;
|
||||
OPENVINO_SUPPRESS_DEPRECATED_START
|
||||
|
||||
static std::string s_manifest = "${MANIFEST}";
|
||||
static std::string s_device = test::backend_name_to_device("${BACKEND_NAME}");
|
||||
static std::string s_device = backend_name_to_device("${BACKEND_NAME}");
|
||||
|
||||
// ############################################################################ CORE TESTS
|
||||
OPENVINO_TEST(${BACKEND_NAME}, onnx_compress_axis_0) {
|
||||
@ -36,7 +37,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_compress_axis_0) {
|
||||
editor.set_input_values(in_vals);
|
||||
|
||||
const auto function = editor.get_function();
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
test_case.add_expected_output<float>(Shape{2, 2}, {3., 4., 5., 6.});
|
||||
test_case.run();
|
||||
@ -53,7 +54,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_compress_axis_1) {
|
||||
editor.set_input_values(in_vals);
|
||||
|
||||
const auto function = editor.get_function();
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
test_case.add_expected_output<float>(Shape{3, 1}, {2., 4., 6.});
|
||||
test_case.run();
|
||||
@ -71,7 +72,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_compress_default_axis) {
|
||||
editor.set_input_values(in_vals);
|
||||
|
||||
const auto function = editor.get_function();
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
test_case.add_expected_output<float>(Shape{2}, {2., 5.});
|
||||
test_case.run();
|
||||
@ -89,7 +90,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_compress_negative_axis) {
|
||||
editor.set_input_values(in_vals);
|
||||
|
||||
const auto function = editor.get_function();
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
|
||||
test_case.add_expected_output<float>(Shape{3, 1}, {2., 4., 6.});
|
||||
test_case.run();
|
||||
@ -109,7 +110,7 @@ TYPED_TEST_P(ElemTypesTests, onnx_test_add_abc_set_precission) {
|
||||
editor.set_input_types({{"A", ng_type}, {"B", ng_type}, {"C", ng_type}});
|
||||
|
||||
const auto function = editor.get_function();
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<DataType>(std::vector<DataType>{1, 2, 3});
|
||||
test_case.add_input<DataType>(std::vector<DataType>{4, 5, 6});
|
||||
test_case.add_input<DataType>(std::vector<DataType>{7, 8, 9});
|
||||
@ -128,7 +129,7 @@ TYPED_TEST_P(ElemTypesTests, onnx_test_split_multioutput_set_precission) {
|
||||
editor.set_input_types({{"input", ng_type}});
|
||||
|
||||
const auto function = editor.get_function();
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<DataType>(std::vector<DataType>{1, 2, 3, 4, 5, 6});
|
||||
test_case.add_expected_output<DataType>(Shape{2}, std::vector<DataType>{1, 2});
|
||||
test_case.add_expected_output<DataType>(Shape{2}, std::vector<DataType>{3, 4});
|
||||
|
@ -8,9 +8,9 @@
|
||||
#include <sstream>
|
||||
|
||||
#include "common_test_utils/file_utils.hpp"
|
||||
#include "common_test_utils/test_case.hpp"
|
||||
#include "common_test_utils/test_control.hpp"
|
||||
#include "editor.hpp"
|
||||
#include "engines_util/test_case.hpp"
|
||||
#include "gtest/gtest.h"
|
||||
#include "ngraph/file_util.hpp"
|
||||
#include "onnx_test_util.hpp"
|
||||
|
@ -12,8 +12,8 @@
|
||||
#include <string>
|
||||
|
||||
#include "common_test_utils/file_utils.hpp"
|
||||
#include "common_test_utils/test_case.hpp"
|
||||
#include "common_test_utils/unicode_utils.hpp"
|
||||
#include "engines_util/test_case.hpp"
|
||||
#include "ie_blob.h"
|
||||
#include "ie_core.hpp"
|
||||
#include "ngraph/ngraph.hpp"
|
||||
@ -129,7 +129,7 @@ TEST_P(OnnxFeMmapFixture, onnx_external_data) {
|
||||
ov::Core core;
|
||||
core.set_property(ov::enable_mmap(GetParam()));
|
||||
const auto model = core.read_model(path);
|
||||
auto test_case = ngraph::test::TestCase(model);
|
||||
auto test_case = ov::test::TestCase(model);
|
||||
test_case.add_input<float>({1.f, 2.f, 3.f, 4.f});
|
||||
test_case.add_expected_output<float>({2, 2}, {3.f, 6.f, 9.f, 12.f});
|
||||
|
||||
@ -149,7 +149,7 @@ TEST_P(OnnxFeMmapFixture, onnx_external_data_from_stream) {
|
||||
const auto in_model = frontend->load(is, path, enable_mmap);
|
||||
const auto model = frontend->convert(in_model);
|
||||
|
||||
auto test_case = ngraph::test::TestCase(model);
|
||||
auto test_case = ov::test::TestCase(model);
|
||||
test_case.add_input<float>({1.f, 2.f, 3.f, 4.f});
|
||||
test_case.add_expected_output<float>(ov::Shape{2, 2}, {3.f, 6.f, 9.f, 12.f});
|
||||
|
||||
@ -183,7 +183,7 @@ TEST_P(OnnxFeMmapFixture, onnx_external_data_optional_fields) {
|
||||
ov::Core core;
|
||||
core.set_property(ov::enable_mmap(GetParam()));
|
||||
const auto model = core.read_model(path);
|
||||
auto test_case = ngraph::test::TestCase(model);
|
||||
auto test_case = ov::test::TestCase(model);
|
||||
test_case.add_input<float>({1.f, 2.f, 3.f, 4.f});
|
||||
test_case.add_expected_output<float>(ov::Shape{2, 2}, {3.f, 6.f, 9.f, 12.f});
|
||||
|
||||
@ -196,7 +196,7 @@ TEST_P(OnnxFeMmapFixture, onnx_external_offset_not_aligned_with_page_size) {
|
||||
ov::Core core;
|
||||
core.set_property(ov::enable_mmap(GetParam()));
|
||||
const auto model = core.read_model(path);
|
||||
auto test_case = ngraph::test::TestCase(model);
|
||||
auto test_case = ov::test::TestCase(model);
|
||||
test_case.add_input<float>({1.f, 2.f, 3.f, 4.f});
|
||||
test_case.add_expected_output<float>(ov::Shape{2, 2}, {3.f, 6.f, 9.f, 12.f});
|
||||
|
||||
@ -210,7 +210,7 @@ TEST_P(OnnxFeMmapFixture, onnx_external_offset_not_aligned_with_page_and_less_th
|
||||
ov::Core core;
|
||||
core.set_property(ov::enable_mmap(GetParam()));
|
||||
const auto model = core.read_model(path);
|
||||
auto test_case = ngraph::test::TestCase(model);
|
||||
auto test_case = ov::test::TestCase(model);
|
||||
test_case.add_input<float>({1.f, 2.f, 3.f, 4.f});
|
||||
test_case.add_expected_output<float>(ov::Shape{2, 2}, {3.f, 6.f, 9.f, 12.f});
|
||||
|
||||
@ -225,7 +225,7 @@ TEST_P(OnnxFeMmapFixture, onnx_external_offset_not_aligned_with_page_and_greater
|
||||
ov::Core core;
|
||||
core.set_property(ov::enable_mmap(GetParam()));
|
||||
const auto model = core.read_model(path);
|
||||
auto test_case = ngraph::test::TestCase(model);
|
||||
auto test_case = ov::test::TestCase(model);
|
||||
test_case.add_input<float>({1.f, 2.f, 3.f, 4.f});
|
||||
test_case.add_expected_output<float>(ov::Shape{2, 2}, {3.f, 6.f, 9.f, 12.f});
|
||||
|
||||
@ -239,7 +239,7 @@ TEST_P(OnnxFeMmapFixture, onnx_external_offset_not_aligned_with_page_in_two_page
|
||||
ov::Core core;
|
||||
core.set_property(ov::enable_mmap(GetParam()));
|
||||
const auto model = core.read_model(path);
|
||||
auto test_case = ngraph::test::TestCase(model);
|
||||
auto test_case = ov::test::TestCase(model);
|
||||
test_case.add_input<float>({1.f, 2.f, 3.f, 4.f});
|
||||
test_case.add_expected_output<float>(ov::Shape{2, 2}, {3.f, 6.f, 9.f, 12.f});
|
||||
|
||||
@ -252,7 +252,7 @@ TEST_P(OnnxFeMmapFixture, onnx_external_data_in_different_paths) {
|
||||
ov::Core core;
|
||||
core.set_property(ov::enable_mmap(GetParam()));
|
||||
const auto model = core.read_model(path);
|
||||
auto test_case = ngraph::test::TestCase(model);
|
||||
auto test_case = ov::test::TestCase(model);
|
||||
// first input: {3.f}, second: {1.f, 2.f, 5.f} read from external files
|
||||
test_case.add_input<float>({2.f, 7.f, 7.f});
|
||||
|
||||
@ -266,7 +266,7 @@ TEST_P(OnnxFeMmapFixture, onnx_external_two_tensors_data_in_the_same_file) {
|
||||
ov::Core core;
|
||||
core.set_property(ov::enable_mmap(GetParam()));
|
||||
const auto model = core.read_model(path);
|
||||
auto test_case = ngraph::test::TestCase(model);
|
||||
auto test_case = ov::test::TestCase(model);
|
||||
// first input: {3, 2, 1}, second: {1, 2, 3} read from external file
|
||||
test_case.add_input<int32_t>({2, 3, 1});
|
||||
|
||||
@ -333,7 +333,7 @@ TEST_P(OnnxFeMmapFixture, onnx_external_data_sanitize_path) {
|
||||
ov::Core core;
|
||||
core.set_property(ov::enable_mmap(GetParam()));
|
||||
const auto model = core.read_model(path);
|
||||
auto test_case = ngraph::test::TestCase(model);
|
||||
auto test_case = ov::test::TestCase(model);
|
||||
test_case.add_input<float>({1.f, 2.f, 3.f, 4.f});
|
||||
test_case.add_expected_output<float>(ov::Shape{2, 2}, {3.f, 6.f, 9.f, 12.f});
|
||||
|
||||
@ -346,7 +346,7 @@ TEST_P(OnnxFeMmapFixture, onnx_external_data_in_constant_node) {
|
||||
ov::Core core;
|
||||
core.set_property(ov::enable_mmap(GetParam()));
|
||||
const auto model = core.read_model(path);
|
||||
auto test_case = ngraph::test::TestCase(model);
|
||||
auto test_case = ov::test::TestCase(model);
|
||||
test_case.add_input<float>({3.f, 5.f, 8.f, 13.f});
|
||||
test_case.add_expected_output<float>(ov::Shape{2, 2}, {4.f, 7.f, 11.f, 17.f});
|
||||
|
||||
|
@ -3,8 +3,8 @@
|
||||
//
|
||||
|
||||
#include "common_test_utils/file_utils.hpp"
|
||||
#include "common_test_utils/test_case.hpp"
|
||||
#include "common_test_utils/test_control.hpp"
|
||||
#include "engines_util/test_case.hpp"
|
||||
#include "gtest/gtest.h"
|
||||
#include "ngraph/ngraph.hpp"
|
||||
#include "onnx_import/onnx.hpp"
|
||||
|
@ -37,6 +37,8 @@ ComparisonResult compare_onnx_models(const std::string& model,
|
||||
const std::string& reference_model_path,
|
||||
CompType comp = default_name_comparator);
|
||||
|
||||
std::string change_opset_version(const std::string& model, const std::vector<int64_t>& new_opset_version, const std::string& domain="ai.onnx");
|
||||
std::string change_opset_version(const std::string& model,
|
||||
const std::vector<int64_t>& new_opset_version,
|
||||
const std::string& domain = "ai.onnx");
|
||||
} // namespace test
|
||||
} // namespace ngraph
|
||||
|
@ -7,21 +7,22 @@
|
||||
|
||||
#include "common_test_utils/all_close.hpp"
|
||||
#include "common_test_utils/file_utils.hpp"
|
||||
#include "common_test_utils/test_case.hpp"
|
||||
#include "common_test_utils/test_control.hpp"
|
||||
#include "common_test_utils/test_tools.hpp"
|
||||
#include "default_opset.hpp"
|
||||
#include "editor.hpp"
|
||||
#include "engines_util/test_case.hpp"
|
||||
#include "gtest/gtest.h"
|
||||
#include "ngraph/file_util.hpp"
|
||||
#include "ngraph/op/util/op_types.hpp"
|
||||
#include "onnx_import/onnx.hpp"
|
||||
#include "onnx_utils.hpp"
|
||||
|
||||
using namespace ngraph;
|
||||
OPENVINO_SUPPRESS_DEPRECATED_START
|
||||
|
||||
static std::string s_manifest = "${MANIFEST}";
|
||||
static std::string s_device = test::backend_name_to_device("${BACKEND_NAME}");
|
||||
static std::string s_device = backend_name_to_device("${BACKEND_NAME}");
|
||||
|
||||
// is there any benefit of running below tests on different backends?
|
||||
// why are these here anyway?
|
||||
@ -29,9 +30,9 @@ static std::string s_device = test::backend_name_to_device("${BACKEND_NAME}");
|
||||
OPENVINO_TEST(${BACKEND_NAME}, add_abc_from_ir) {
|
||||
const auto ir_xml =
|
||||
file_util::path_join(ov::test::utils::getExecutableDirectory(), TEST_MODEL_ZOO, "core/models/ir/add_abc.xml");
|
||||
const auto function = test::function_from_ir(ir_xml);
|
||||
const auto function = function_from_ir(ir_xml);
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>({1});
|
||||
test_case.add_input<float>({2});
|
||||
test_case.add_input<float>({3});
|
||||
@ -45,9 +46,9 @@ OPENVINO_TEST(${BACKEND_NAME}, add_abc_from_ir_with_bin_path) {
|
||||
file_util::path_join(ov::test::utils::getExecutableDirectory(), TEST_MODEL_ZOO, "core/models/ir/add_abc.xml");
|
||||
const auto ir_bin =
|
||||
file_util::path_join(ov::test::utils::getExecutableDirectory(), TEST_MODEL_ZOO, "core/models/ir/add_abc.bin");
|
||||
const auto function = test::function_from_ir(ir_xml, ir_bin);
|
||||
const auto function = function_from_ir(ir_xml, ir_bin);
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
auto test_case = ov::test::TestCase(function, s_device);
|
||||
test_case.add_input<float>({1});
|
||||
test_case.add_input<float>({2});
|
||||
test_case.add_input<float>({3});
|
||||
|
@ -6,4 +6,22 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "openvino/runtime/core.hpp"
|
||||
#include "common_test_utils/test_constants.hpp"
|
||||
|
||||
static const std::string ONNX_FE = "onnx";
|
||||
|
||||
inline std::string backend_name_to_device(const std::string& backend_name) {
|
||||
if (backend_name == "INTERPRETER")
|
||||
return ov::test::utils::DEVICE_TEMPLATE;
|
||||
if (backend_name == "IE_CPU")
|
||||
return ov::test::utils::DEVICE_CPU;
|
||||
if (backend_name == "IE_GPU")
|
||||
return ov::test::utils::DEVICE_GPU;
|
||||
OPENVINO_THROW("Unsupported backend name");
|
||||
}
|
||||
|
||||
inline std::shared_ptr<ov::Model> function_from_ir(const std::string& xml_path, const std::string& bin_path = {}) {
|
||||
ov::Core c;
|
||||
return c.read_model(xml_path, bin_path);
|
||||
}
|
||||
|
@ -5,6 +5,6 @@
|
||||
#include <openvino/frontend/onnx/frontend.hpp>
|
||||
|
||||
void test_load() {
|
||||
ov::frontend::onnx::FrontEnd fe;
|
||||
ov::frontend::onnx::FrontEnd fe;
|
||||
fe.get_name();
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ target_include_directories(${TARGET_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../
|
||||
|
||||
target_link_libraries(${TARGET_NAME}
|
||||
PUBLIC
|
||||
engines_test_util offline_transformations
|
||||
offline_transformations
|
||||
common_test_utils func_test_utils openvino::util
|
||||
openvino::runtime
|
||||
PRIVATE
|
||||
|
@ -6,8 +6,8 @@
|
||||
|
||||
#include <cnpy.h>
|
||||
|
||||
#include "common_test_utils/test_case.hpp"
|
||||
#include "common_test_utils/test_control.hpp"
|
||||
#include "engines_util/test_case.hpp"
|
||||
#include "utils.hpp"
|
||||
|
||||
using namespace ngraph;
|
||||
@ -37,7 +37,7 @@ void FrontEndFuzzyOpTest::doLoadFromFile() {
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline void addInputOutput(const cnpy::NpyArray& npy_array, test::TestCase& test_case, bool is_input = true) {
|
||||
inline void addInputOutput(const cnpy::NpyArray& npy_array, ov::test::TestCase& test_case, bool is_input = true) {
|
||||
const T* npy_begin = npy_array.data<T>();
|
||||
std::vector<T> data(npy_begin, npy_begin + npy_array.num_vals);
|
||||
if (is_input)
|
||||
@ -64,7 +64,7 @@ void FrontEndFuzzyOpTest::runConvertedModel(const std::shared_ptr<ngraph::Functi
|
||||
auto modelFolder = getModelFolder(modelFile);
|
||||
|
||||
// run test
|
||||
auto testCase = test::TestCase(function, "CPU");
|
||||
auto testCase = ov::test::TestCase(function, "CPU");
|
||||
|
||||
const auto parameters = function->get_parameters();
|
||||
for (size_t i = 0; i < parameters.size(); i++) {
|
||||
|
@ -31,7 +31,6 @@ ov_deprecated_no_errors()
|
||||
|
||||
add_subdirectory(ngraph_helpers)
|
||||
add_subdirectory(test_utils)
|
||||
add_subdirectory(engines_util)
|
||||
|
||||
if(ENABLE_FUNCTIONAL_TESTS)
|
||||
add_subdirectory(functional)
|
||||
|
@ -1,21 +0,0 @@
|
||||
# Copyright (C) 2018-2023 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
file(GLOB_RECURSE ENGINES_UTIL_SRC "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/*.hpp")
|
||||
|
||||
add_library(engines_test_util STATIC EXCLUDE_FROM_ALL ${ENGINES_UTIL_SRC})
|
||||
|
||||
ie_faster_build(engines_test_util UNITY)
|
||||
|
||||
target_link_libraries(engines_test_util PUBLIC openvino::runtime openvino::runtime::dev gtest gmock common_test_utils)
|
||||
|
||||
target_include_directories(engines_test_util
|
||||
PUBLIC
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/.."
|
||||
PRIVATE
|
||||
$<TARGET_PROPERTY:common_test_utils,INTERFACE_INCLUDE_DIRECTORIES>)
|
||||
|
||||
|
||||
add_clang_format_target(engines_test_util_clang FOR_SOURCES ${ENGINES_UTIL_SRC})
|
@ -1,180 +0,0 @@
|
||||
// Copyright (C) 2018-2023 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
#include "execute_tools.hpp"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include "ngraph/ngraph.hpp"
|
||||
#include "ngraph/util.hpp"
|
||||
|
||||
NGRAPH_SUPPRESS_DEPRECATED_START
|
||||
|
||||
using namespace std;
|
||||
using namespace ngraph;
|
||||
|
||||
// This function traverses the vector of ops and verifies that each op's dependencies (its inputs)
|
||||
// is located earlier in the vector. That is enough to be valid
|
||||
bool validate_list(const vector<shared_ptr<Node>>& nodes) {
|
||||
bool rc = true;
|
||||
for (auto it = nodes.rbegin(); it != nodes.rend(); it++) {
|
||||
auto node_tmp = *it;
|
||||
NodeVector dependencies_tmp;
|
||||
for (auto& val : node_tmp->input_values())
|
||||
dependencies_tmp.emplace_back(val.get_node_shared_ptr());
|
||||
vector<Node*> dependencies;
|
||||
|
||||
for (shared_ptr<Node> n : dependencies_tmp) {
|
||||
dependencies.push_back(n.get());
|
||||
}
|
||||
auto tmp = it;
|
||||
for (tmp++; tmp != nodes.rend(); tmp++) {
|
||||
auto dep_tmp = *tmp;
|
||||
auto found = find(dependencies.begin(), dependencies.end(), dep_tmp.get());
|
||||
if (found != dependencies.end()) {
|
||||
dependencies.erase(found);
|
||||
}
|
||||
}
|
||||
if (dependencies.size() > 0) {
|
||||
rc = false;
|
||||
}
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
shared_ptr<Function> make_test_graph() {
|
||||
auto arg_0 = make_shared<op::Parameter>(element::f32, Shape{2, 2});
|
||||
auto arg_1 = make_shared<op::Parameter>(element::f32, Shape{2, 2});
|
||||
auto arg_2 = make_shared<op::Parameter>(element::f32, Shape{2, 2});
|
||||
auto arg_3 = make_shared<op::Parameter>(element::f32, Shape{2, 2});
|
||||
auto arg_4 = make_shared<op::Parameter>(element::f32, Shape{2, 2});
|
||||
auto arg_5 = make_shared<op::Parameter>(element::f32, Shape{2, 2});
|
||||
|
||||
auto t0 = make_shared<op::v1::Add>(arg_0, arg_1);
|
||||
auto t1 = make_shared<op::MatMul>(t0, arg_2);
|
||||
auto t2 = make_shared<op::v1::Multiply>(t0, arg_3);
|
||||
|
||||
auto t3 = make_shared<op::v1::Add>(t1, arg_4);
|
||||
auto t4 = make_shared<op::v1::Add>(t2, arg_5);
|
||||
|
||||
auto r0 = make_shared<op::v1::Add>(t3, t4);
|
||||
|
||||
auto f0 = make_shared<Function>(r0, ParameterVector{arg_0, arg_1, arg_2, arg_3, arg_4, arg_5});
|
||||
|
||||
return f0;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void init_int_tv(ngraph::runtime::Tensor* tv, std::default_random_engine& engine, T min, T max) {
|
||||
size_t size = tv->get_element_count();
|
||||
std::uniform_int_distribution<T> dist(min, max);
|
||||
std::vector<T> vec(size);
|
||||
for (T& element : vec) {
|
||||
element = dist(engine);
|
||||
}
|
||||
tv->write(vec.data(), vec.size() * sizeof(T));
|
||||
}
|
||||
|
||||
template <>
|
||||
void init_int_tv<char>(ngraph::runtime::Tensor* tv, std::default_random_engine& engine, char min, char max) {
|
||||
size_t size = tv->get_element_count();
|
||||
std::uniform_int_distribution<int16_t> dist(static_cast<short>(min), static_cast<short>(max));
|
||||
std::vector<char> vec(size);
|
||||
for (char& element : vec) {
|
||||
element = static_cast<char>(dist(engine));
|
||||
}
|
||||
tv->write(vec.data(), vec.size() * sizeof(char));
|
||||
}
|
||||
|
||||
template <>
|
||||
void init_int_tv<int8_t>(ngraph::runtime::Tensor* tv, std::default_random_engine& engine, int8_t min, int8_t max) {
|
||||
size_t size = tv->get_element_count();
|
||||
std::uniform_int_distribution<int16_t> dist(static_cast<short>(min), static_cast<short>(max));
|
||||
std::vector<int8_t> vec(size);
|
||||
for (int8_t& element : vec) {
|
||||
element = static_cast<int8_t>(dist(engine));
|
||||
}
|
||||
tv->write(vec.data(), vec.size() * sizeof(int8_t));
|
||||
}
|
||||
|
||||
template <>
|
||||
void init_int_tv<uint8_t>(ngraph::runtime::Tensor* tv, std::default_random_engine& engine, uint8_t min, uint8_t max) {
|
||||
size_t size = tv->get_element_count();
|
||||
std::uniform_int_distribution<int16_t> dist(static_cast<short>(min), static_cast<short>(max));
|
||||
std::vector<uint8_t> vec(size);
|
||||
for (uint8_t& element : vec) {
|
||||
element = static_cast<uint8_t>(dist(engine));
|
||||
}
|
||||
tv->write(vec.data(), vec.size() * sizeof(uint8_t));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void init_real_tv(ngraph::runtime::Tensor* tv, std::default_random_engine& engine, T min, T max) {
|
||||
size_t size = tv->get_element_count();
|
||||
std::uniform_real_distribution<T> dist(min, max);
|
||||
std::vector<T> vec(size);
|
||||
for (T& element : vec) {
|
||||
element = dist(engine);
|
||||
}
|
||||
tv->write(vec.data(), vec.size() * sizeof(T));
|
||||
}
|
||||
|
||||
void random_init(ngraph::runtime::Tensor* tv, std::default_random_engine& engine) {
|
||||
element::Type et = tv->get_element_type();
|
||||
if (et == element::boolean) {
|
||||
init_int_tv<char>(tv, engine, 0, 1);
|
||||
} else if (et == element::f32) {
|
||||
init_real_tv<float>(tv, engine, numeric_limits<float>::min(), 1.0f);
|
||||
} else if (et == element::f64) {
|
||||
init_real_tv<double>(tv, engine, numeric_limits<double>::min(), 1.0);
|
||||
} else if (et == element::i8) {
|
||||
init_int_tv<int8_t>(tv, engine, -1, 1);
|
||||
} else if (et == element::i16) {
|
||||
init_int_tv<int16_t>(tv, engine, -1, 1);
|
||||
} else if (et == element::i32) {
|
||||
init_int_tv<int32_t>(tv, engine, 0, 1);
|
||||
} else if (et == element::i64) {
|
||||
init_int_tv<int64_t>(tv, engine, 0, 1);
|
||||
} else if (et == element::u8) {
|
||||
init_int_tv<uint8_t>(tv, engine, 0, 1);
|
||||
} else if (et == element::u16) {
|
||||
init_int_tv<uint16_t>(tv, engine, 0, 1);
|
||||
} else if (et == element::u32) {
|
||||
init_int_tv<uint32_t>(tv, engine, 0, 1);
|
||||
} else if (et == element::u64) {
|
||||
init_int_tv<uint64_t>(tv, engine, 0, 1);
|
||||
} else {
|
||||
throw runtime_error("unsupported type");
|
||||
}
|
||||
}
|
||||
|
||||
::testing::AssertionResult test_ordered_ops(shared_ptr<Function> f, const NodeVector& required_ops) {
|
||||
unordered_set<Node*> seen;
|
||||
for (auto& node_ptr : f->get_ordered_ops()) {
|
||||
Node* node = node_ptr.get();
|
||||
if (seen.count(node) > 0) {
|
||||
return ::testing::AssertionFailure() << "Duplication in ordered ops";
|
||||
}
|
||||
size_t arg_count = node->get_input_size();
|
||||
for (size_t i = 0; i < arg_count; ++i) {
|
||||
Node* dep = node->get_input_node_ptr(i);
|
||||
if (seen.count(dep) == 0) {
|
||||
return ::testing::AssertionFailure() << "Argument " << *dep << " does not occur before op" << *node;
|
||||
}
|
||||
}
|
||||
for (auto& dep_ptr : node->get_control_dependencies()) {
|
||||
if (seen.count(dep_ptr.get()) == 0) {
|
||||
return ::testing::AssertionFailure()
|
||||
<< "Control dependency " << *dep_ptr << " does not occur before op" << *node;
|
||||
}
|
||||
}
|
||||
seen.insert(node);
|
||||
}
|
||||
for (auto& node_ptr : required_ops) {
|
||||
if (seen.count(node_ptr.get()) == 0) {
|
||||
return ::testing::AssertionFailure() << "Required op " << *node_ptr << "does not occur in ordered ops";
|
||||
}
|
||||
}
|
||||
return ::testing::AssertionSuccess();
|
||||
}
|
@ -1,54 +0,0 @@
|
||||
// Copyright (C) 2018-2023 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <random>
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
#include "ngraph/runtime/host_tensor.hpp"
|
||||
#include "openvino/core/model.hpp"
|
||||
#include "openvino/core/node.hpp"
|
||||
#include "openvino/core/shape.hpp"
|
||||
#include "openvino/op/op.hpp"
|
||||
|
||||
bool validate_list(const std::vector<std::shared_ptr<ov::Node>>& nodes);
|
||||
std::shared_ptr<ov::Model> make_test_graph();
|
||||
|
||||
OPENVINO_SUPPRESS_DEPRECATED_START
|
||||
template <typename T>
|
||||
void copy_data(const std::shared_ptr<ngraph::runtime::Tensor>& tv, const std::vector<T>& data) {
|
||||
size_t data_size = data.size() * sizeof(T);
|
||||
if (data_size > 0) {
|
||||
tv->write(data.data(), data_size);
|
||||
}
|
||||
}
|
||||
|
||||
template <>
|
||||
inline void copy_data<bool>(const std::shared_ptr<ngraph::runtime::Tensor>& tv, const std::vector<bool>& data) {
|
||||
std::vector<char> data_char(data.begin(), data.end());
|
||||
copy_data(tv, data_char);
|
||||
}
|
||||
|
||||
template <ov::element::Type_t ET>
|
||||
ngraph::HostTensorPtr make_host_tensor(const ov::Shape& shape,
|
||||
const std::vector<typename ov::element_type_traits<ET>::value_type>& data) {
|
||||
NGRAPH_CHECK(shape_size(shape) == data.size(), "Incorrect number of initialization elements");
|
||||
auto host_tensor = std::make_shared<ngraph::runtime::HostTensor>(ET, shape);
|
||||
copy_data(host_tensor, data);
|
||||
return host_tensor;
|
||||
}
|
||||
|
||||
void random_init(ngraph::runtime::Tensor* tv, std::default_random_engine& engine);
|
||||
|
||||
template <ov::element::Type_t ET>
|
||||
ngraph::HostTensorPtr make_host_tensor(const ov::Shape& shape) {
|
||||
auto host_tensor = std::make_shared<ngraph::runtime::HostTensor>(ET, shape);
|
||||
static std::default_random_engine engine(2112);
|
||||
random_init(host_tensor.get(), engine);
|
||||
return host_tensor;
|
||||
}
|
||||
OPENVINO_SUPPRESS_DEPRECATED_END
|
||||
|
||||
testing::AssertionResult test_ordered_ops(std::shared_ptr<ov::Model> f, const ov::NodeVector& required_ops);
|
@ -13,26 +13,15 @@
|
||||
#include "openvino/runtime/core.hpp"
|
||||
#include "openvino/util/file_util.hpp"
|
||||
|
||||
namespace ngraph {
|
||||
namespace ov {
|
||||
namespace test {
|
||||
inline std::string backend_name_to_device(const std::string& backend_name) {
|
||||
if (backend_name == "INTERPRETER")
|
||||
return "TEMPLATE";
|
||||
if (backend_name == "IE_CPU")
|
||||
return "CPU";
|
||||
if (backend_name == "IE_GPU")
|
||||
return "GPU";
|
||||
OPENVINO_THROW("Unsupported backend name");
|
||||
}
|
||||
|
||||
std::shared_ptr<ov::Model> function_from_ir(const std::string& xml_path, const std::string& bin_path = {});
|
||||
|
||||
class TestCase {
|
||||
public:
|
||||
TestCase(const std::shared_ptr<ov::Model>& function, const std::string& dev = "TEMPLATE");
|
||||
|
||||
template <typename T>
|
||||
void add_input(const Shape& shape, const std::vector<T>& values) {
|
||||
void add_input(const ov::Shape& shape, const std::vector<T>& values) {
|
||||
const auto params = m_function->get_parameters();
|
||||
OPENVINO_ASSERT(m_input_index < params.size(), "All function parameters already have inputs.");
|
||||
|
||||
@ -95,7 +84,7 @@ public:
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void add_input_from_file(const Shape& shape, const std::string& basepath, const std::string& filename) {
|
||||
void add_input_from_file(const ov::Shape& shape, const std::string& basepath, const std::string& filename) {
|
||||
const auto filepath = ov::util::path_join({basepath, filename});
|
||||
add_input_from_file<T>(shape, filepath);
|
||||
}
|
||||
@ -107,7 +96,7 @@ public:
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void add_input_from_file(const Shape& shape, const std::string& filepath) {
|
||||
void add_input_from_file(const ov::Shape& shape, const std::string& filepath) {
|
||||
const auto value = read_binary_file<T>(filepath);
|
||||
add_input<T>(shape, value);
|
||||
}
|
||||
@ -119,7 +108,7 @@ public:
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void add_expected_output(const Shape& expected_shape, const std::vector<T>& values) {
|
||||
void add_expected_output(const ov::Shape& expected_shape, const std::vector<T>& values) {
|
||||
const auto results = m_function->get_results();
|
||||
|
||||
OPENVINO_ASSERT(m_output_index < results.size(), "All model results already have expected outputs.");
|
||||
@ -155,10 +144,8 @@ public:
|
||||
void add_expected_output_from_file(const ov::Shape& expected_shape,
|
||||
const std::string& basepath,
|
||||
const std::string& filename) {
|
||||
OPENVINO_SUPPRESS_DEPRECATED_START
|
||||
const auto filepath = ov::util::path_join({basepath, filename});
|
||||
add_expected_output_from_file<T>(expected_shape, filepath);
|
||||
OPENVINO_SUPPRESS_DEPRECATED_END
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
@ -167,38 +154,9 @@ public:
|
||||
add_expected_output<T>(expected_shape, values);
|
||||
}
|
||||
|
||||
void run(const size_t tolerance_bits = DEFAULT_FLOAT_TOLERANCE_BITS) {
|
||||
m_request.infer();
|
||||
const auto res = compare_results(tolerance_bits);
|
||||
void run(const size_t tolerance_bits = DEFAULT_FLOAT_TOLERANCE_BITS);
|
||||
|
||||
if (res.first != testing::AssertionSuccess()) {
|
||||
std::cout << "Results comparison failed for output: " << res.second << std::endl;
|
||||
std::cout << res.first.message() << std::endl;
|
||||
}
|
||||
|
||||
m_input_index = 0;
|
||||
m_output_index = 0;
|
||||
|
||||
m_expected_outputs.clear();
|
||||
|
||||
EXPECT_TRUE(res.first);
|
||||
}
|
||||
|
||||
void run_with_tolerance_as_fp(const float tolerance = 1.0e-5f) {
|
||||
m_request.infer();
|
||||
const auto res = compare_results_with_tolerance_as_fp(tolerance);
|
||||
|
||||
if (res != testing::AssertionSuccess()) {
|
||||
std::cout << res.message() << std::endl;
|
||||
}
|
||||
|
||||
m_input_index = 0;
|
||||
m_output_index = 0;
|
||||
|
||||
m_expected_outputs.clear();
|
||||
|
||||
EXPECT_TRUE(res);
|
||||
}
|
||||
void run_with_tolerance_as_fp(const float tolerance = 1.0e-5f);
|
||||
|
||||
private:
|
||||
std::shared_ptr<ov::Model> m_function;
|
||||
@ -211,4 +169,4 @@ private:
|
||||
testing::AssertionResult compare_results_with_tolerance_as_fp(float tolerance_bits);
|
||||
};
|
||||
} // namespace test
|
||||
} // namespace ngraph
|
||||
} // namespace ov
|
@ -284,7 +284,7 @@ void fill_data_with_broadcast(ov::Tensor& tensor, ov::Tensor& values) {
|
||||
}
|
||||
}
|
||||
|
||||
template<ov::element::Type_t SRC_E, ov::element::Type_t DST_E>
|
||||
template<ov::element::Type_t SRC_E, ov::element::Type_t DST_E, typename std::enable_if<SRC_E != DST_E, int>::type = 0>
|
||||
void copy_tensor_with_convert(const ov::Tensor& src_tensor, ov::Tensor& dst_tensor) {
|
||||
using SRC_TYPE = typename ov::fundamental_type_for<SRC_E>;
|
||||
using DST_TYPE = typename ov::fundamental_type_for<DST_E>;
|
||||
@ -301,6 +301,11 @@ void copy_tensor_with_convert(const ov::Tensor& src_tensor, ov::Tensor& dst_tens
|
||||
std::transform(src_ptr, src_ptr + src_size, dst_ptr, converter);
|
||||
}
|
||||
|
||||
template<ov::element::Type_t SRC_E, ov::element::Type_t DST_E, typename std::enable_if<SRC_E == DST_E, int>::type = 0>
|
||||
void copy_tensor_with_convert(const ov::Tensor& src_tensor, ov::Tensor& dst_tensor) {
|
||||
src_tensor.copy_to(dst_tensor);
|
||||
}
|
||||
|
||||
ov::Tensor make_tensor_with_precision_convert(const ov::Tensor& tensor, ov::element::Type prc) {
|
||||
ov::Tensor new_tensor(prc, tensor.get_shape());
|
||||
auto src_prc = tensor.get_element_type();
|
||||
|
@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
#include "test_case.hpp"
|
||||
#include "common_test_utils/test_case.hpp"
|
||||
|
||||
#include "common_test_utils/all_close_f.hpp"
|
||||
#include "common_test_utils/data_utils.hpp"
|
||||
@ -79,12 +79,8 @@ compare_values(const ov::Tensor& expected_tensor, const ov::Tensor& result_tenso
|
||||
}
|
||||
}; // namespace
|
||||
|
||||
namespace ngraph {
|
||||
namespace ov {
|
||||
namespace test {
|
||||
std::shared_ptr<ov::Model> function_from_ir(const std::string& xml_path, const std::string& bin_path) {
|
||||
ov::Core c;
|
||||
return c.read_model(xml_path, bin_path);
|
||||
}
|
||||
|
||||
std::pair<testing::AssertionResult, size_t> TestCase::compare_results(size_t tolerance_bits) {
|
||||
auto res = testing::AssertionSuccess();
|
||||
@ -203,5 +199,38 @@ TestCase::TestCase(const std::shared_ptr<ov::Model>& function, const std::string
|
||||
m_request = m_core.compile_model(function, dev).create_infer_request();
|
||||
}
|
||||
|
||||
void TestCase::run(const size_t tolerance_bits) {
|
||||
m_request.infer();
|
||||
const auto res = compare_results(tolerance_bits);
|
||||
|
||||
if (res.first != testing::AssertionSuccess()) {
|
||||
std::cout << "Results comparison failed for output: " << res.second << std::endl;
|
||||
std::cout << res.first.message() << std::endl;
|
||||
}
|
||||
|
||||
m_input_index = 0;
|
||||
m_output_index = 0;
|
||||
|
||||
m_expected_outputs.clear();
|
||||
|
||||
EXPECT_TRUE(res.first);
|
||||
}
|
||||
|
||||
void TestCase::run_with_tolerance_as_fp(const float tolerance) {
|
||||
m_request.infer();
|
||||
const auto res = compare_results_with_tolerance_as_fp(tolerance);
|
||||
|
||||
if (res != testing::AssertionSuccess()) {
|
||||
std::cout << res.message() << std::endl;
|
||||
}
|
||||
|
||||
m_input_index = 0;
|
||||
m_output_index = 0;
|
||||
|
||||
m_expected_outputs.clear();
|
||||
|
||||
EXPECT_TRUE(res);
|
||||
}
|
||||
|
||||
} // namespace test
|
||||
} // namespace ngraph
|
||||
} // namespace ov
|
Loading…
Reference in New Issue
Block a user